mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 05:09:53 +01:00
Use black text for the expiry extension notice.
This commit is contained in:
@@ -86,7 +86,8 @@ public class NavDrawerActivity extends BriarActivity implements
|
|||||||
} else if (intent.getBooleanExtra(INTENT_FORUMS, false)) {
|
} else if (intent.getBooleanExtra(INTENT_FORUMS, false)) {
|
||||||
startFragment(ForumListFragment.newInstance(), R.id.nav_btn_forums);
|
startFragment(ForumListFragment.newInstance(), R.id.nav_btn_forums);
|
||||||
} else if (intent.getBooleanExtra(INTENT_CONTACTS, false)) {
|
} else if (intent.getBooleanExtra(INTENT_CONTACTS, false)) {
|
||||||
startFragment(ContactListFragment.newInstance(), R.id.nav_btn_contacts);
|
startFragment(ContactListFragment.newInstance(),
|
||||||
|
R.id.nav_btn_contacts);
|
||||||
} else if (intent.getBooleanExtra(INTENT_BLOGS, false)) {
|
} else if (intent.getBooleanExtra(INTENT_BLOGS, false)) {
|
||||||
startFragment(FeedFragment.newInstance(), R.id.nav_btn_blogs);
|
startFragment(FeedFragment.newInstance(), R.id.nav_btn_blogs);
|
||||||
}
|
}
|
||||||
@@ -124,7 +125,8 @@ public class NavDrawerActivity extends BriarActivity implements
|
|||||||
transportsView.setAdapter(transportsAdapter);
|
transportsView.setAdapter(transportsAdapter);
|
||||||
|
|
||||||
if (state == null) {
|
if (state == null) {
|
||||||
startFragment(ContactListFragment.newInstance(), R.id.nav_btn_contacts);
|
startFragment(ContactListFragment.newInstance(),
|
||||||
|
R.id.nav_btn_contacts);
|
||||||
}
|
}
|
||||||
if (getIntent() != null) {
|
if (getIntent() != null) {
|
||||||
onNewIntent(getIntent());
|
onNewIntent(getIntent());
|
||||||
@@ -181,7 +183,7 @@ public class NavDrawerActivity extends BriarActivity implements
|
|||||||
clearBackStack();
|
clearBackStack();
|
||||||
loadFragment(item.getItemId());
|
loadFragment(item.getItemId());
|
||||||
//Don't display the Settings Item as checked
|
//Don't display the Settings Item as checked
|
||||||
if (item.getItemId() == R.id.nav_btn_settings){
|
if (item.getItemId() == R.id.nav_btn_settings) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -207,7 +209,8 @@ public class NavDrawerActivity extends BriarActivity implements
|
|||||||
* exiting. This models the typical Google navigation behaviour such
|
* exiting. This models the typical Google navigation behaviour such
|
||||||
* as in Gmail/Inbox.
|
* as in Gmail/Inbox.
|
||||||
*/
|
*/
|
||||||
startFragment(ContactListFragment.newInstance(), R.id.nav_btn_contacts);
|
startFragment(ContactListFragment.newInstance(),
|
||||||
|
R.id.nav_btn_contacts);
|
||||||
} else {
|
} else {
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
}
|
}
|
||||||
@@ -231,7 +234,7 @@ public class NavDrawerActivity extends BriarActivity implements
|
|||||||
signOut(false);
|
signOut(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startFragment(BaseFragment fragment, int itemId){
|
private void startFragment(BaseFragment fragment, int itemId) {
|
||||||
navigation.setCheckedItem(itemId);
|
navigation.setCheckedItem(itemId);
|
||||||
startFragment(fragment);
|
startFragment(fragment);
|
||||||
}
|
}
|
||||||
@@ -277,6 +280,9 @@ public class NavDrawerActivity extends BriarActivity implements
|
|||||||
expiryWarning = (ViewGroup) findViewById(R.id.expiryWarning);
|
expiryWarning = (ViewGroup) findViewById(R.id.expiryWarning);
|
||||||
TextView expiryWarningText =
|
TextView expiryWarningText =
|
||||||
(TextView) expiryWarning.findViewById(R.id.expiryWarningText);
|
(TextView) expiryWarning.findViewById(R.id.expiryWarningText);
|
||||||
|
// make close button functional
|
||||||
|
ImageView expiryWarningClose =
|
||||||
|
(ImageView) expiryWarning.findViewById(R.id.expiryWarningClose);
|
||||||
|
|
||||||
// show a different snackbar in green if this is an update
|
// show a different snackbar in green if this is an update
|
||||||
if (expiry == UPDATE) {
|
if (expiry == UPDATE) {
|
||||||
@@ -284,15 +290,16 @@ public class NavDrawerActivity extends BriarActivity implements
|
|||||||
ContextCompat.getColor(this, R.color.briar_green_light));
|
ContextCompat.getColor(this, R.color.briar_green_light));
|
||||||
expiryWarningText.setText(
|
expiryWarningText.setText(
|
||||||
getString(R.string.expiry_update, daysUntilExpiry));
|
getString(R.string.expiry_update, daysUntilExpiry));
|
||||||
|
expiryWarningText.setTextColor(
|
||||||
|
ContextCompat.getColor(this, android.R.color.black));
|
||||||
|
expiryWarningClose.setColorFilter(
|
||||||
|
ContextCompat.getColor(this, android.R.color.black));
|
||||||
} else {
|
} else {
|
||||||
expiryWarningText.setText(getResources()
|
expiryWarningText.setText(getResources()
|
||||||
.getQuantityString(R.plurals.expiry_warning, daysUntilExpiry,
|
.getQuantityString(R.plurals.expiry_warning,
|
||||||
daysUntilExpiry));
|
daysUntilExpiry, daysUntilExpiry));
|
||||||
}
|
}
|
||||||
|
|
||||||
// make close button functional
|
|
||||||
ImageView expiryWarningClose =
|
|
||||||
(ImageView) expiryWarning.findViewById(R.id.expiryWarningClose);
|
|
||||||
expiryWarningClose.setOnClickListener(new View.OnClickListener() {
|
expiryWarningClose.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|||||||
Reference in New Issue
Block a user