Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
nevenz committed Sep 21, 2022
1 parent c865d0e commit 61c4cdc
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 56 deletions.
2 changes: 0 additions & 2 deletions app/src/main/java/com/orgzly/android/AppIntent.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.orgzly.android;

public class AppIntent {
public static final String ACTION_DB_UPGRADE_STARTED = "com.orgzly.intent.action.DB_UPGRADE_STARTED";
public static final String ACTION_DB_UPGRADE_ENDED = "com.orgzly.intent.action.DB_UPGRADE_ENDED";
public static final String ACTION_BOOK_IMPORTED = "com.orgzly.intent.action.BOOK_IMPORTED";
public static final String ACTION_DB_CLEARED = "com.orgzly.intent.action.DB_CLEARED";
public static final String ACTION_UPDATING_NOTES_STARTED = "com.orgzly.intent.action.UPDATING_NOTES_STARTED";
Expand Down
14 changes: 0 additions & 14 deletions app/src/main/java/com/orgzly/android/ui/CommonActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,6 @@ abstract class CommonActivity : AppCompatActivity() {
if (BuildConfig.LOG_DEBUG) LogUtils.d(TAG, "Received broadcast: $intent")

when (intent.action) {
AppIntent.ACTION_DB_UPGRADE_STARTED -> {
whatsNewDialog?.getButton(AlertDialog.BUTTON_POSITIVE)?.setText(R.string.running_database_update)
whatsNewDialog?.getButton(DialogInterface.BUTTON_POSITIVE)?.isEnabled = false
whatsNewDialog?.setCancelable(false)
}

AppIntent.ACTION_DB_UPGRADE_ENDED -> {
whatsNewDialog?.getButton(AlertDialog.BUTTON_POSITIVE)?.setText(R.string.ok)
whatsNewDialog?.getButton(DialogInterface.BUTTON_POSITIVE)?.isEnabled = true
whatsNewDialog?.setCancelable(true)
}

AppIntent.ACTION_BOOK_IMPORTED ->
showSnackbar(R.string.notebook_imported)

Expand Down Expand Up @@ -158,8 +146,6 @@ abstract class CommonActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)

val intentFilter = IntentFilter()
intentFilter.addAction(AppIntent.ACTION_DB_UPGRADE_STARTED)
intentFilter.addAction(AppIntent.ACTION_DB_UPGRADE_ENDED)
intentFilter.addAction(AppIntent.ACTION_BOOK_IMPORTED)
intentFilter.addAction(AppIntent.ACTION_DB_CLEARED)
intentFilter.addAction(AppIntent.ACTION_UPDATING_NOTES_STARTED)
Expand Down
6 changes: 2 additions & 4 deletions app/src/main/res/layout/dialog_period_with_type.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
android:id="@+id/type_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/space_between_content_areas"
android:layout_marginRight="@dimen/space_between_content_areas" />
android:layout_marginEnd="@dimen/space_between_content_areas" />

<NumberPicker
android:id="@+id/value_picker"
Expand All @@ -53,8 +52,7 @@
android:id="@+id/unit_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/space_between_content_areas"
android:layout_marginLeft="@dimen/space_between_content_areas" />
android:layout_marginStart="@dimen/space_between_content_areas" />

</LinearLayout>

Expand Down
3 changes: 0 additions & 3 deletions app/src/main/res/layout/dialog_refile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:paddingStart="@dimen/screen_edge"
android:paddingLeft="@dimen/screen_edge"
android:paddingEnd="@dimen/screen_edge"
android:paddingRight="@dimen/screen_edge"
android:scrollHorizontally="true"
android:gravity="center_vertical"
android:linksClickable="true"
Expand All @@ -51,7 +49,6 @@
style="@style/BorderlessButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:contentDescription="@string/refile"
android:src="@drawable/ic_move_to_inbox"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/drawer_item_sync_needed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:src="@drawable/ic_sync"
android:contentDescription="@string/sync" />

Expand Down
12 changes: 4 additions & 8 deletions app/src/main/res/layout/fragment_note.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,13 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/screen_edge"
android:layout_marginLeft="@dimen/screen_edge"
android:src="@drawable/ic_info_outline" />

<TextView
android:id="@+id/metadata_header_text"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/fragment_note_icon_margin"
android:layout_marginStart="@dimen/fragment_note_icon_margin"
android:textSize="?attr/fragment_note_content_text_size"
android:text="@string/metadata"
Expand All @@ -116,14 +114,14 @@
android:id="@+id/metadata_header_up_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="12dp"
android:layout_marginEnd="12dp"
android:src="@drawable/ic_keyboard_arrow_up" />

<ImageView
android:id="@+id/metadata_header_down_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="12dp"
android:layout_marginEnd="12dp"
android:src="@drawable/ic_keyboard_arrow_down"
android:visibility="gone"/>

Expand Down Expand Up @@ -289,15 +287,13 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/screen_edge"
android:layout_marginLeft="@dimen/screen_edge"
android:src="@drawable/ic_notes" />

<TextView
android:id="@+id/content_header_text"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/fragment_note_icon_margin"
android:layout_marginStart="@dimen/fragment_note_icon_margin"
android:textSize="?attr/fragment_note_content_text_size"
android:text="@string/content"
Expand All @@ -307,14 +303,14 @@
android:id="@+id/content_header_up_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="12dp"
android:layout_marginEnd="12dp"
android:src="@drawable/ic_keyboard_arrow_up" />

<ImageView
android:id="@+id/content_header_down_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="12dp"
android:layout_marginEnd="12dp"
android:src="@drawable/ic_keyboard_arrow_down"
android:visibility="gone"/>

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/fragment_sync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
android:id="@+id/sync_button_text"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:gravity="center_vertical"
tools:text="@string/sync_button_sample"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/item_book.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@
android:layout_height="wrap_content"
android:gravity="start|center_vertical"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
tools:text="@string/repo_url_sample"
android:textSize="?attr/item_book_details_text_size"/>
</LinearLayout>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/item_browser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/screen_edge"
android:paddingRight="@dimen/screen_edge"
android:paddingStart="@dimen/screen_edge"
android:paddingEnd="@dimen/screen_edge"
android:minHeight="48dp"
android:orientation="horizontal"
android:gravity="center_vertical">
Expand Down
10 changes: 2 additions & 8 deletions app/src/main/res/layout/item_list_widget.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingLeft="8dp"
android:paddingStart="8dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
Expand Down Expand Up @@ -59,7 +58,6 @@
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/widget_post_title_text_size_14"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:maxLines="1"
android:ellipsize="end" />
</LinearLayout>
Expand Down Expand Up @@ -90,7 +88,6 @@
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/widget_post_title_text_size_14"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:maxLines="1"
android:ellipsize="end" />
</LinearLayout>
Expand Down Expand Up @@ -121,7 +118,6 @@
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/widget_post_title_text_size_14"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:maxLines="1"
android:ellipsize="end" />
</LinearLayout>
Expand Down Expand Up @@ -152,7 +148,6 @@
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/widget_post_title_text_size_14"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:maxLines="1"
android:ellipsize="end" />
</LinearLayout>
Expand Down Expand Up @@ -183,7 +178,6 @@
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/widget_post_title_text_size_14"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:maxLines="1"
android:ellipsize="end" />
</LinearLayout>
Expand All @@ -197,8 +191,8 @@
android:minWidth="0dp"
android:paddingTop="@dimen/widget_padding"
android:paddingBottom="0dp"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/ic_check_circle_outline" />
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/item_list_widget_divider.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:maxLines="1"
Expand Down
9 changes: 4 additions & 5 deletions app/src/main/res/layout/list_widget.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<LinearLayout
android:id="@+id/list_widget_header_bar"
style="@style/BorderlessButton"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingStart="0dp"
android:paddingEnd="0dp"
android:gravity="start"
android:layout_weight="1"
android:layout_width="0dp"
Expand All @@ -40,8 +40,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:text="@string/list_widget_select_search"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/widget_header_text_size_14"
Expand Down Expand Up @@ -81,7 +81,6 @@
android:clipToPadding="false"
android:paddingTop="@dimen/widget_padding"
android:paddingBottom="@dimen/widget_padding"
android:paddingLeft="@dimen/widget_padding"
android:paddingStart="@dimen/widget_padding"
android:divider="@null"
android:dividerHeight="0dp" />
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/property.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<EditText
android:id="@+id/value"
style="@style/NoteFragmentMetadataItemValueButton"
android:layout_marginLeft="0dp"
android:layout_marginStart="0dp"
android:maxLines="1"
android:inputType="text"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/quick_bar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
android:id="@+id/quick_bar_flipper"
android:layout_width="match_parent"
android:layout_height="@dimen/quick_bar_height"
android:paddingLeft="@dimen/screen_edge"
android:paddingRight="@dimen/screen_edge"
android:paddingStart="@dimen/screen_edge"
android:paddingEnd="@dimen/screen_edge"
android:visibility="visible"
android:gravity="center">

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/text_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
tools:text="This is some change"/>

Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ android.useAndroidX = true
android.enableJetifier = true
android.databinding.incremental = true

kotlin.code.style = official
kotlin.code.style = official

# org.gradle.warning.mode=all

0 comments on commit 61c4cdc

Please sign in to comment.