mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 04:37:25 +01:00
Fix status bar and navbar icon color in MainActivity.
This commit is contained in:
parent
6f24ac8cf5
commit
2f15383718
@ -168,6 +168,8 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
|
||||
|
||||
EventBus.getDefault().register(this);
|
||||
|
||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
|
||||
Resources resources = getResources();
|
||||
|
||||
@ -299,12 +301,20 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
|
||||
mNewAccountName = null;
|
||||
if(newAccount == null) {
|
||||
mNullAccessToken = true;
|
||||
|
||||
if(mMenu != null) {
|
||||
mMenu.findItem(R.id.action_subscriptions_main_activity).setVisible(false);
|
||||
}
|
||||
} else {
|
||||
mAccessToken = newAccount.getAccessToken();
|
||||
mAccountName = newAccount.getUsername();
|
||||
mProfileImageUrl = newAccount.getProfileImageUrl();
|
||||
mBannerImageUrl = newAccount.getBannerImageUrl();
|
||||
mKarma = newAccount.getKarma();
|
||||
|
||||
if(mMenu != null) {
|
||||
mMenu.findItem(R.id.action_subscriptions_main_activity).setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
if(enableNotification) {
|
||||
@ -333,6 +343,10 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
|
||||
mBannerImageUrl = account.getBannerImageUrl();
|
||||
mKarma = account.getKarma();
|
||||
|
||||
if(mMenu != null) {
|
||||
mMenu.findItem(R.id.action_subscriptions_main_activity).setVisible(true);
|
||||
}
|
||||
|
||||
if(enableNotification) {
|
||||
Constraints constraints = new Constraints.Builder()
|
||||
.setRequiredNetworkType(NetworkType.CONNECTED)
|
||||
@ -355,12 +369,20 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
|
||||
} else {
|
||||
if(account == null) {
|
||||
mNullAccessToken = true;
|
||||
|
||||
if(mMenu != null) {
|
||||
mMenu.findItem(R.id.action_subscriptions_main_activity).setVisible(false);
|
||||
}
|
||||
} else {
|
||||
mAccessToken = account.getAccessToken();
|
||||
mAccountName = account.getUsername();
|
||||
mProfileImageUrl = account.getProfileImageUrl();
|
||||
mBannerImageUrl = account.getBannerImageUrl();
|
||||
mKarma = account.getKarma();
|
||||
|
||||
if(mMenu != null) {
|
||||
mMenu.findItem(R.id.action_subscriptions_main_activity).setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
if(enableNotification) {
|
||||
@ -679,6 +701,14 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
|
||||
getMenuInflater().inflate(R.menu.main_activity, menu);
|
||||
mMenu = menu;
|
||||
MenuItem lazyModeItem = mMenu.findItem(R.id.action_lazy_mode_main_activity);
|
||||
MenuItem subscriptionsItem = mMenu.findItem(R.id.action_subscriptions_main_activity);
|
||||
|
||||
if(mAccessToken != null) {
|
||||
subscriptionsItem.setVisible(true);
|
||||
} else {
|
||||
subscriptionsItem.setVisible(false);
|
||||
}
|
||||
|
||||
if(isInLazyMode) {
|
||||
lazyModeItem.setTitle(R.string.action_stop_lazy_mode);
|
||||
params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_NO_SCROLL);
|
||||
@ -695,6 +725,10 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_subscriptions_main_activity:
|
||||
Intent subscriptionsIntent = new Intent(this, SubscribedThingListingActivity.class);
|
||||
startActivity(subscriptionsIntent);
|
||||
return true;
|
||||
case R.id.action_sort_main_activity:
|
||||
if(viewPager.getCurrentItem() == 1 ||viewPager.getCurrentItem() == 2) {
|
||||
popularAndAllSortTypeBottomSheetFragment.show(getSupportFragmentManager(), popularAndAllSortTypeBottomSheetFragment.getTag());
|
||||
|
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM16.59,7.58L10,14.17l-2.59,-2.58L6,13l4,4 8,-8z"/>
|
||||
</vector>
|
@ -4,11 +4,12 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:application="ml.docilealligator.infinityforreddit.MainActivity">
|
||||
<item
|
||||
android:id="@+id/action_sort_main_activity"
|
||||
android:id="@+id/action_subscriptions_main_activity"
|
||||
android:orderInCategory="1"
|
||||
android:title="@string/action_sort"
|
||||
android:icon="@drawable/ic_outline_sort_24px"
|
||||
app:showAsAction="ifRoom" />
|
||||
android:title="@string/action_subscriptions"
|
||||
android:icon="@drawable/ic_outline_check_circle_outline_white_24px"
|
||||
app:showAsAction="ifRoom"
|
||||
android:visible="false"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_search_main_activity"
|
||||
@ -18,14 +19,21 @@
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_refresh_main_activity"
|
||||
android:id="@+id/action_sort_main_activity"
|
||||
android:orderInCategory="3"
|
||||
android:title="@string/action_sort"
|
||||
android:icon="@drawable/ic_outline_sort_24px"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_refresh_main_activity"
|
||||
android:orderInCategory="4"
|
||||
android:title="@string/action_refresh"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_lazy_mode_main_activity"
|
||||
android:orderInCategory="4"
|
||||
android:orderInCategory="5"
|
||||
android:title="@string/action_start_lazy_mode"
|
||||
app:showAsAction="never" />
|
||||
</menu>
|
@ -30,6 +30,7 @@
|
||||
<string name="action_stop_lazy_mode">Stop Lazy Mode</string>
|
||||
<string name="action_send">Send</string>
|
||||
<string name="action_sort">Sort</string>
|
||||
<string name="action_subscriptions">Subscriptions</string>
|
||||
<string name="action_hide_post">Hide Post</string>
|
||||
<string name="action_unhide_post">Unhide Post</string>
|
||||
<string name="action_edit_post">Edit Post</string>
|
||||
|
Loading…
Reference in New Issue
Block a user