Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed About page crash issue #2084

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions app/src/main/java/io/pslab/fragment/AboutUsFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public AboutUsFragment() {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_about_us, container, false);
simulateDayNight(0);
ButterKnife.bind(this, view);
View aboutPage = new AboutPage(getActivity())
.isRTL(false)
Expand Down Expand Up @@ -69,25 +68,6 @@ public boolean onOptionsItemSelected(MenuItem item) {
return super.onOptionsItemSelected(item);
}

private void simulateDayNight(int currentSetting) {
final int DAY = 0;
final int NIGHT = 1;
final int FOLLOW_SYSTEM = 3;

int currentNightMode = getResources().getConfiguration().uiMode
& Configuration.UI_MODE_NIGHT_MASK;
if (currentSetting == DAY && currentNightMode != Configuration.UI_MODE_NIGHT_NO) {
AppCompatDelegate.setDefaultNightMode(
AppCompatDelegate.MODE_NIGHT_NO);
} else if (currentSetting == NIGHT && currentNightMode != Configuration.UI_MODE_NIGHT_YES) {
AppCompatDelegate.setDefaultNightMode(
AppCompatDelegate.MODE_NIGHT_YES);
} else if (currentSetting == FOLLOW_SYSTEM) {
AppCompatDelegate.setDefaultNightMode(
AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
}
}

private Element addDevelopers() {
Element developersElement = new Element();
developersElement.setTitle(getString(R.string.developers));
Expand All @@ -101,5 +81,4 @@ private Element addDevelopers() {
});
return developersElement;
}

}