Skip to content

Commit

Permalink
Merge pull request #84 from mantas84/change-theme-sample-fix
Browse files Browse the repository at this point in the history
static theme variable added back
  • Loading branch information
jrvansuita authored Apr 26, 2020
2 parents 367c193 + 338f9dd commit 38aa803
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class ActivitySample extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setTheme(SampleHelper.theme);
setContentView(R.layout.sample_view);
SampleHelper.with(this).init().loadAbout();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class FragmentActivitySample extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme(SampleHelper.theme);
setContentView(new LinearLayout(this));

getSupportFragmentManager()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public class SampleHelper implements View.OnClickListener {

private Activity activity;
private int theme = R.style.AppThemeDark;
public static int theme = R.style.AppThemeDark;

private SampleHelper(Activity activity) {
this.activity = activity;
Expand All @@ -26,7 +26,6 @@ public static SampleHelper with(Activity activity) {
}

public SampleHelper init() {
activity.setTheme(theme);

activity.findViewById(R.id.dark).setOnClickListener(this);
activity.findViewById(R.id.light).setOnClickListener(this);
Expand Down

0 comments on commit 38aa803

Please sign in to comment.