Theme and Icons #260
|
@ -17,10 +17,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||||
|
|
||||||
final TinyDB tinyDb = new TinyDB(getApplicationContext());
|
final TinyDB tinyDb = new TinyDB(getApplicationContext());
|
||||||
|
|
||||||
if(tinyDb.getInt("themeId") == 0) {
|
if(tinyDb.getInt("themeId") == 1) {
|
||||||
|
|||||||
setTheme(R.style.AppTheme);
|
|
||||||
}
|
|
||||||
else if(tinyDb.getInt("themeId") == 1) {
|
|
||||||
setTheme(R.style.AppThemeLight);
|
setTheme(R.style.AppThemeLight);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -114,13 +114,10 @@ public class RepoStargazersAdapter extends BaseAdapter {
|
||||||
viewHolder.memberName.setTypeface(myTypeface);
|
viewHolder.memberName.setTypeface(myTypeface);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tinyDb.getInt("themeId") == 0) { // dark
|
if(tinyDb.getInt("themeId") == 1) { //light
|
||||||
6543
commented
same as first comment - why not make if (is light) [else if (is other theme - not here jet)] else default -> dark theme same as first comment - why not make if (is light) [else if (is other theme - not here jet)] else default -> dark theme
mmarif
commented
Yup, you are right. Yup, you are right.
|
|||||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.white));
|
|
||||||
}
|
|
||||||
else if(tinyDb.getInt("themeId") == 1) { //light
|
|
||||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.lightThemeTextColor));
|
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.lightThemeTextColor));
|
||||||
}
|
}
|
||||||
else {
|
else { // dark
|
||||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.white));
|
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.white));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,13 +114,10 @@ public class RepoWatchersAdapter extends BaseAdapter {
|
||||||
viewHolder.memberName.setTypeface(myTypeface);
|
viewHolder.memberName.setTypeface(myTypeface);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tinyDb.getInt("themeId") == 0) { // dark
|
if(tinyDb.getInt("themeId") == 1) { //light
|
||||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.white));
|
|
||||||
}
|
|
||||||
else if(tinyDb.getInt("themeId") == 1) { //light
|
|
||||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.lightThemeTextColor));
|
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.lightThemeTextColor));
|
||||||
}
|
}
|
||||||
else {
|
else { // dark
|
||||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.white));
|
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.white));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -115,13 +115,10 @@ public class TeamMembersByOrgAdapter extends BaseAdapter {
|
||||||
viewHolder.memberName.setTypeface(myTypeface);
|
viewHolder.memberName.setTypeface(myTypeface);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tinyDb.getInt("themeId") == 0) { // dark
|
if(tinyDb.getInt("themeId") == 1) { //light
|
||||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.white));
|
|
||||||
}
|
|
||||||
else if(tinyDb.getInt("themeId") == 1) { //light
|
|
||||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.lightThemeTextColor));
|
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.lightThemeTextColor));
|
||||||
}
|
}
|
||||||
else {
|
else { // dark
|
||||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.white));
|
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.white));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user
can you test for == 1 and else set default theme?
Yes, that will work too.