Font now changes according to last change when starting application, added scrollView to location detail, location detail now takes location name and description and added 2 discriptions to location.json

This commit is contained in:
sebas
2021-01-06 11:54:39 +01:00
parent 0e63bff0f1
commit deb599db25
4 changed files with 37 additions and 12 deletions

View File

@@ -22,6 +22,7 @@ import com.a1.nextlocation.R;
public class SettingsFragment extends Fragment {
private ImageView imageButton;
SwitchCompat fontChanger;
@Override
@@ -53,8 +54,14 @@ public class SettingsFragment extends Fragment {
fontChanger = view.findViewById(R.id.BigFont);
SharedPreferences sharedPreferences = requireActivity().getSharedPreferences("com.a1.nextlocation",0);
final SharedPreferences.Editor editor = sharedPreferences.edit();
fontChanger.setChecked(sharedPreferences.getBoolean("switch",false));
SharedPreferences.Editor editor = sharedPreferences.edit();
fontChanger.setChecked(sharedPreferences.getBoolean("switch", false));
if (fontChanger.isChecked()){
requireActivity().setTheme(R.style.Theme_NextLocationBig);
}else if (!fontChanger.isChecked()){
requireActivity().setTheme(R.style.Theme_NextLocation);
}
fontChanger.setOnClickListener(view1 -> {
if(fontChanger.isChecked())