Browse Source

refactor: minor refactoring

develop
Ezerous 2 years ago
parent
commit
610b0fc594
  1. 17
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java
  2. 2
      app/src/main/res/layout/activity_bookmarks.xml
  3. 1
      app/src/main/res/layout/activity_topic.xml
  4. 2
      app/src/main/res/menu/downloads_menu.xml
  5. 2
      app/src/main/res/menu/shoutbox_menu.xml
  6. 6
      app/src/main/res/menu/topic_menu.xml
  7. 2
      app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  8. 2
      app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  9. 4
      app/src/main/res/values/ic_launcher_background.xml
  10. 1
      app/src/main/res/values/strings.xml

17
app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java

@ -228,11 +228,12 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle presses on the action bar items
switch (item.getItemId()) {
case R.id.menu_bookmark:
int itemId = item.getItemId();
if (itemId == R.id.menu_bookmark) {
topicMenuBookmarkClick();
return true;
case R.id.menu_info:
}
else if (itemId == R.id.menu_info) {
AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.AppCompatAlertDialogStyleAccent);
LayoutInflater inflater = this.getLayoutInflater();
LinearLayout infoDialog = (LinearLayout) inflater.inflate(R.layout.dialog_topic_info
@ -255,15 +256,15 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo
topicInfoDialog = builder.create();
topicInfoDialog.show();
return true;
case R.id.menu_share:
Intent sendIntent = new Intent(android.content.Intent.ACTION_SEND);
}
else if (itemId == R.id.menu_share) {
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setType("text/plain");
sendIntent.putExtra(android.content.Intent.EXTRA_TEXT, viewModel.getTopicUrl());
sendIntent.putExtra(Intent.EXTRA_TEXT, viewModel.getTopicUrl());
startActivity(Intent.createChooser(sendIntent, "Share via"));
return true; //invalidateOptionsMenu();
default:
return super.onOptionsItemSelected(item);
}
return super.onOptionsItemSelected(item);
}
@Override

2
app/src/main/res/layout/activity_bookmarks.xml

@ -21,7 +21,7 @@
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:gravity="center"
app:popupTheme="@style/ToolbarTheme"></androidx.appcompat.widget.Toolbar>
app:popupTheme="@style/ToolbarTheme" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/bookmark_tabs"

1
app/src/main/res/layout/activity_topic.xml

@ -148,6 +148,7 @@
android:layout_gravity="bottom|end"
android:layout_marginEnd="@dimen/fab_margins"
android:layout_marginBottom="50dp"
android:contentDescription="@string/reply_button"
app:layout_behavior="gr.thmmy.mthmmy.utils.ui.ScrollAwareFABBehavior"
app:srcCompat="@drawable/ic_reply" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

2
app/src/main/res/menu/downloads_menu.xml

@ -5,5 +5,5 @@
android:id="@+id/menu_upload"
android:icon="@drawable/ic_file_upload_white_24dp"
app:showAsAction="ifRoom"
android:title="@string/upload_button"></item>
android:title="@string/upload_button" />
</menu>

2
app/src/main/res/menu/shoutbox_menu.xml

@ -5,5 +5,5 @@
android:id="@+id/menu_refresh"
android:icon="@drawable/ic_refresh_white_24dp"
app:showAsAction="ifRoom"
android:title="@string/refresh"></item>
android:title="@string/refresh" />
</menu>

6
app/src/main/res/menu/topic_menu.xml

@ -5,15 +5,15 @@
android:id="@+id/menu_bookmark"
android:icon="@drawable/ic_bookmark_false_accent_24dp"
app:showAsAction="ifRoom"
android:title="@string/bookmark"></item>
android:title="@string/bookmark" />
<item
android:id="@+id/menu_share"
android:icon="@drawable/ic_share_white_24dp"
app:showAsAction="ifRoom"
android:title="@string/share"></item>
android:title="@string/share" />
<item
android:id="@+id/menu_info"
android:icon="@drawable/ic_info_outline_white_24dp"
app:showAsAction="ifRoom"
android:title="@string/info"></item>
android:title="@string/info" />
</menu>

2
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background" />
<background android:drawable="@color/primary_light" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

2
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background" />
<background android:drawable="@color/primary_light" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

4
app/src/main/res/values/ic_launcher_background.xml

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#333333</color>
</resources>

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

@ -76,6 +76,7 @@
</plurals>
<string name="show_vote_options_button">hide results</string>
<string name="pref_topic_drafts_key">preference-topic-drafts-key</string>
<string name="reply_button">Reply</string>
<!--Profile Activity-->
<string name="username">Username</string>

Loading…
Cancel
Save