mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-13 11:47:14 +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);
|
EventBus.getDefault().register(this);
|
||||||
|
|
||||||
|
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
|
||||||
Resources resources = getResources();
|
Resources resources = getResources();
|
||||||
|
|
||||||
@ -299,12 +301,20 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
|
|||||||
mNewAccountName = null;
|
mNewAccountName = null;
|
||||||
if(newAccount == null) {
|
if(newAccount == null) {
|
||||||
mNullAccessToken = true;
|
mNullAccessToken = true;
|
||||||
|
|
||||||
|
if(mMenu != null) {
|
||||||
|
mMenu.findItem(R.id.action_subscriptions_main_activity).setVisible(false);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mAccessToken = newAccount.getAccessToken();
|
mAccessToken = newAccount.getAccessToken();
|
||||||
mAccountName = newAccount.getUsername();
|
mAccountName = newAccount.getUsername();
|
||||||
mProfileImageUrl = newAccount.getProfileImageUrl();
|
mProfileImageUrl = newAccount.getProfileImageUrl();
|
||||||
mBannerImageUrl = newAccount.getBannerImageUrl();
|
mBannerImageUrl = newAccount.getBannerImageUrl();
|
||||||
mKarma = newAccount.getKarma();
|
mKarma = newAccount.getKarma();
|
||||||
|
|
||||||
|
if(mMenu != null) {
|
||||||
|
mMenu.findItem(R.id.action_subscriptions_main_activity).setVisible(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(enableNotification) {
|
if(enableNotification) {
|
||||||
@ -333,6 +343,10 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
|
|||||||
mBannerImageUrl = account.getBannerImageUrl();
|
mBannerImageUrl = account.getBannerImageUrl();
|
||||||
mKarma = account.getKarma();
|
mKarma = account.getKarma();
|
||||||
|
|
||||||
|
if(mMenu != null) {
|
||||||
|
mMenu.findItem(R.id.action_subscriptions_main_activity).setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
if(enableNotification) {
|
if(enableNotification) {
|
||||||
Constraints constraints = new Constraints.Builder()
|
Constraints constraints = new Constraints.Builder()
|
||||||
.setRequiredNetworkType(NetworkType.CONNECTED)
|
.setRequiredNetworkType(NetworkType.CONNECTED)
|
||||||
@ -355,12 +369,20 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
|
|||||||
} else {
|
} else {
|
||||||
if(account == null) {
|
if(account == null) {
|
||||||
mNullAccessToken = true;
|
mNullAccessToken = true;
|
||||||
|
|
||||||
|
if(mMenu != null) {
|
||||||
|
mMenu.findItem(R.id.action_subscriptions_main_activity).setVisible(false);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mAccessToken = account.getAccessToken();
|
mAccessToken = account.getAccessToken();
|
||||||
mAccountName = account.getUsername();
|
mAccountName = account.getUsername();
|
||||||
mProfileImageUrl = account.getProfileImageUrl();
|
mProfileImageUrl = account.getProfileImageUrl();
|
||||||
mBannerImageUrl = account.getBannerImageUrl();
|
mBannerImageUrl = account.getBannerImageUrl();
|
||||||
mKarma = account.getKarma();
|
mKarma = account.getKarma();
|
||||||
|
|
||||||
|
if(mMenu != null) {
|
||||||
|
mMenu.findItem(R.id.action_subscriptions_main_activity).setVisible(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(enableNotification) {
|
if(enableNotification) {
|
||||||
@ -679,6 +701,14 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
|
|||||||
getMenuInflater().inflate(R.menu.main_activity, menu);
|
getMenuInflater().inflate(R.menu.main_activity, menu);
|
||||||
mMenu = menu;
|
mMenu = menu;
|
||||||
MenuItem lazyModeItem = mMenu.findItem(R.id.action_lazy_mode_main_activity);
|
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) {
|
if(isInLazyMode) {
|
||||||
lazyModeItem.setTitle(R.string.action_stop_lazy_mode);
|
lazyModeItem.setTitle(R.string.action_stop_lazy_mode);
|
||||||
params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_NO_SCROLL);
|
params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_NO_SCROLL);
|
||||||
@ -695,6 +725,10 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
|
|||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
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:
|
case R.id.action_sort_main_activity:
|
||||||
if(viewPager.getCurrentItem() == 1 ||viewPager.getCurrentItem() == 2) {
|
if(viewPager.getCurrentItem() == 1 ||viewPager.getCurrentItem() == 2) {
|
||||||
popularAndAllSortTypeBottomSheetFragment.show(getSupportFragmentManager(), popularAndAllSortTypeBottomSheetFragment.getTag());
|
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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
tools:application="ml.docilealligator.infinityforreddit.MainActivity">
|
tools:application="ml.docilealligator.infinityforreddit.MainActivity">
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_sort_main_activity"
|
android:id="@+id/action_subscriptions_main_activity"
|
||||||
android:orderInCategory="1"
|
android:orderInCategory="1"
|
||||||
android:title="@string/action_sort"
|
android:title="@string/action_subscriptions"
|
||||||
android:icon="@drawable/ic_outline_sort_24px"
|
android:icon="@drawable/ic_outline_check_circle_outline_white_24px"
|
||||||
app:showAsAction="ifRoom" />
|
app:showAsAction="ifRoom"
|
||||||
|
android:visible="false"/>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_search_main_activity"
|
android:id="@+id/action_search_main_activity"
|
||||||
@ -18,14 +19,21 @@
|
|||||||
app:showAsAction="ifRoom" />
|
app:showAsAction="ifRoom" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_refresh_main_activity"
|
android:id="@+id/action_sort_main_activity"
|
||||||
android:orderInCategory="3"
|
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"
|
android:title="@string/action_refresh"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_lazy_mode_main_activity"
|
android:id="@+id/action_lazy_mode_main_activity"
|
||||||
android:orderInCategory="4"
|
android:orderInCategory="5"
|
||||||
android:title="@string/action_start_lazy_mode"
|
android:title="@string/action_start_lazy_mode"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
</menu>
|
</menu>
|
@ -30,6 +30,7 @@
|
|||||||
<string name="action_stop_lazy_mode">Stop Lazy Mode</string>
|
<string name="action_stop_lazy_mode">Stop Lazy Mode</string>
|
||||||
<string name="action_send">Send</string>
|
<string name="action_send">Send</string>
|
||||||
<string name="action_sort">Sort</string>
|
<string name="action_sort">Sort</string>
|
||||||
|
<string name="action_subscriptions">Subscriptions</string>
|
||||||
<string name="action_hide_post">Hide Post</string>
|
<string name="action_hide_post">Hide Post</string>
|
||||||
<string name="action_unhide_post">Unhide Post</string>
|
<string name="action_unhide_post">Unhide Post</string>
|
||||||
<string name="action_edit_post">Edit Post</string>
|
<string name="action_edit_post">Edit Post</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user