dark mode bug fixes

This commit is contained in:
2020-12-10 09:18:17 -05:00
parent 8af61891fb
commit 167a4ce7c9
15 changed files with 102 additions and 7 deletions

6
app/.classpath Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>

34
app/.project Normal file
View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app</name>
<comment>Project app created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1606852722445</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

View File

@@ -0,0 +1,2 @@
connection.project.dir=..
eclipse.preferences.version=1

View File

@@ -1,7 +1,6 @@
package com.josh.trackcovid19v2;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
@@ -43,6 +42,7 @@ public class MainActivity extends AppCompatActivity {
Toast.makeText(getApplicationContext(), "Data Imported Successfully",Toast.LENGTH_SHORT).show();
}
public static void hideKeyboardFrom(Activity activity) {
InputMethodManager imm = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
//Find the currently focused view, so we can grab the correct window token from it.

View File

@@ -24,6 +24,8 @@ public class SettingsActivity extends AppCompatActivity {
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
System.out.println("SettingsActivity OnCreate");
Log.i("steaass","asdfasdfasfdasdfafs onCretaaa");
}
public static class SettingsFragment extends PreferenceFragmentCompat {
@@ -37,17 +39,15 @@ public class SettingsActivity extends AppCompatActivity {
public boolean onPreferenceChange(Preference preference, Object newValue) {
if (AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_YES) {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
darkModeSwitch.setDefaultValue(true);
Log.i("aa","set off dark mode");
} else {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
darkModeSwitch.setDefaultValue(false);
Log.i("aa","set on dark mode");
darkModeSwitch.setEnabled(true);
}
return false;
}
});
}
}
}
}

View File

@@ -23,7 +23,7 @@ import retrofit2.converter.gson.GsonConverterFactory;
public class NetworkUtils {
private static final String LOG_TAG = NetworkUtils.class.getSimpleName();
private static final String BASE_URL = "https://disease.sh/";
private static final String BASE_URL = "https://corona.lmao.ninja/";
private static Retrofit getRetrofit() {
return new Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(GsonConverterFactory

View File

@@ -7,7 +7,7 @@
<SwitchPreference
android:key="darkMode"
android:title="Dark Mode"
android:defaultValue="false"
android:summaryOff="Disabled"
android:summaryOn="Enabled"/>