Skip to content

Commit 2f382bf

Browse files
committed
migration to androidX, changed main activity
1 parent 591bd1b commit 2f382bf

File tree

7 files changed

+35
-16
lines changed

7 files changed

+35
-16
lines changed

.idea/assetWizardSettings.xml

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/androidTest/java/com/hackware/mormont/notebook/ExampleInstrumentedTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.hackware.mormont.notebook
22

3-
import android.support.test.InstrumentationRegistry
4-
import android.support.test.runner.AndroidJUnit4
3+
import androidx.test.InstrumentationRegistry
4+
import androidx.test.runner.AndroidJUnit4
55

66
import org.junit.Test
77
import org.junit.runner.RunWith

app/src/main/java/com/hackware/mormont/notebook/MainActivity.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package com.hackware.mormont.notebook
22

33
import android.content.Intent
4-
import android.support.v7.app.AppCompatActivity
4+
import androidx.appcompat.app.AppCompatActivity
55
import android.os.Bundle
6-
import android.support.design.widget.Snackbar
7-
import android.text.BoringLayout
86
import android.view.*
97
import android.widget.PopupMenu
108

@@ -19,7 +17,6 @@ class MainActivity : AppCompatActivity(), PopupMenu.OnMenuItemClickListener {
1917
fab.setOnClickListener { view ->
2018
startActivity(Intent(this, Editor::class.java))
2119
}
22-
2320
}
2421

2522
override fun onCreateOptionsMenu(menu: Menu): Boolean {
@@ -56,6 +53,5 @@ class MainActivity : AppCompatActivity(), PopupMenu.OnMenuItemClickListener {
5653
R.id.settings -> true
5754
else -> false
5855
}
59-
6056
}
6157
}
Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<android.support.design.widget.CoordinatorLayout
2+
<androidx.coordinatorlayout.widget.CoordinatorLayout
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
xmlns:tools="http://schemas.android.com/tools"
55
xmlns:app="http://schemas.android.com/apk/res-auto"
@@ -10,17 +10,34 @@
1010

1111

1212
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content">
13-
<android.support.v7.widget.Toolbar
13+
<androidx.appcompat.widget.Toolbar
1414
android:id="@+id/toolbar"
1515
android:layout_width="match_parent"
1616
android:layout_height="match_parent"
1717
android:layout_margin="10dp"
1818
app:theme="@style/CustomToolbar"
1919
app:title="@string/app_name"
2020
android:elevation="10dp">
21-
</android.support.v7.widget.Toolbar>
21+
</androidx.appcompat.widget.Toolbar>
2222
</LinearLayout>
23-
<android.support.design.widget.FloatingActionButton
23+
24+
<androidx.appcompat.widget.AppCompatImageView
25+
android:layout_width="75dp"
26+
android:layout_height="75dp"
27+
android:layout_marginBottom="20dp"
28+
android:layout_gravity="center"
29+
android:src="@drawable/ic_event_note_black_24dp"/>
30+
<TextView
31+
android:layout_width="wrap_content"
32+
android:layout_height="wrap_content"
33+
android:textAlignment="center"
34+
android:text="@string/tryAddnewNote"
35+
android:layout_gravity="center"
36+
android:layout_marginTop="120dp"
37+
android:textSize="14sp"
38+
android:textStyle="bold" android:fontFamily="sans-serif"/>
39+
40+
<com.google.android.material.floatingactionbutton.FloatingActionButton
2441
android:id="@+id/fab"
2542
android:layout_width="wrap_content"
2643
android:layout_height="wrap_content"
@@ -29,5 +46,4 @@
2946
android:layout_margin="16dp"
3047
android:src="@drawable/ic_edit_black_24dp"/>
3148

32-
</android.support.design.widget.CoordinatorLayout>
33-
49+
</androidx.coordinatorlayout.widget.CoordinatorLayout>

app/src/main/res/values/colors.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@
88
<color name="secondaryDarkColor">#003c8f</color>
99
<color name="primaryTextColor">#000000</color>
1010
<color name="secondaryTextColor">#ffffff</color>
11+
<color name="sourceThemeBackgroundColor">#2D2F36</color>
12+
<color name="sourceThemeTextColor">#757C94</color>
1113
</resources>

app/src/main/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@
33
<string name="newNoteTip">Create a new note</string>
44
<string name="menuSettings">Настройки</string>
55
<string name="searchMenu">Найти</string>
6+
<string name="tryAddnewNote">Создание первой заметки</string>
7+
<string name="NoteEditorHint">Начните вводить заметку сюда</string>
8+
<string name="titleHint">Название</string>
69
</resources>

0 commit comments

Comments
 (0)