Commit 107aea53 authored by Varun Patil's avatar Varun Patil

Add color inverted lotus placeholder

parent 18b6d82c
......@@ -50,6 +50,7 @@ public final class Utils {
private static String sessionId;
private static RetrofitInterface retrofitInterface;
public static Gson gson;
public static boolean isDarkTheme = false;
public static final void loadImageWithPlaceholder(final ImageView imageView, final String url) {
Picasso.get()
......@@ -232,6 +233,7 @@ public final class Utils {
}
public static void changeTheme(SettingsFragment fragment, boolean darkTheme) {
isDarkTheme = darkTheme;
FragmentActivity fragmentActivity = fragment.getActivity();
fragmentActivity.setTheme(darkTheme ? R.style.AppThemeDark : R.style.AppTheme);
......
......@@ -118,7 +118,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
/* Check for dark theme */
SharedPreferences sharedPref = getSharedPreferences(Constants.PREF_NAME, Context.MODE_PRIVATE);
if(sharedPref.getBoolean(Constants.DARK_THEME, false))
Utils.isDarkTheme = sharedPref.getBoolean(Constants.DARK_THEME, false);
if (Utils.isDarkTheme)
this.setTheme(R.style.AppThemeDark);
ServiceGenerator serviceGenerator = new ServiceGenerator(getApplicationContext());
......
......@@ -37,6 +37,6 @@ public class FeedAdapter extends CardAdapter<Event> {
@Override
public int getAvatarPlaceholder(Event event) {
return R.drawable.lotus_placeholder;
return Utils.isDarkTheme ? R.drawable.lotus_placeholder_dark : R.drawable.lotus_placeholder;
}
}
......@@ -33,6 +33,6 @@ public class GenericAdapter extends CardAdapter<CardInterface> {
if (cardInterface instanceof User) {
return R.drawable.user_placeholder;
}
return R.drawable.lotus_placeholder;
return Utils.isDarkTheme ? R.drawable.lotus_placeholder_dark : R.drawable.lotus_placeholder;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment