Skip to content

Commit

Permalink
Custom font size in more locations
Browse files Browse the repository at this point in the history
 From Email
  • Loading branch information
Rdlgrmpf committed Sep 29, 2016
1 parent 7e38f0b commit 6ca3afb
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
Expand Down Expand Up @@ -163,6 +164,11 @@ private void loadActivity(boolean initial){
edit = (id != -1);

SimpleCursorAdapter adapter = null;
// Should we set a custom font size?
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
if (sp.getBoolean(SettingsActivity.PREF_CUSTOM_FONT, false)) {
etName.setTextSize(Float.parseFloat(sp.getString(SettingsActivity.PREF_CUTSOM_FONT_SIZE, "15")));
}

//CategorySpinner
Cursor c = DbAccess.getCategories(getBaseContext());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
Expand Down Expand Up @@ -113,6 +114,12 @@ private void loadActivity(boolean initial){
edit = (id != -1);

SimpleCursorAdapter adapter = null;
// Should we set a custom font size?
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
if (sp.getBoolean(SettingsActivity.PREF_CUSTOM_FONT, false)) {
etName.setTextSize(Float.parseFloat(sp.getString(SettingsActivity.PREF_CUTSOM_FONT_SIZE, "15")));
etNewItem.setTextSize(Float.parseFloat(sp.getString(SettingsActivity.PREF_CUTSOM_FONT_SIZE, "15")));
}

//CategorySpinner
Cursor c = DbAccess.getCategories(getBaseContext());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
Expand Down Expand Up @@ -112,6 +113,11 @@ private void loadActivity(boolean initial){
edit = (id != -1);

SimpleCursorAdapter adapter = null;
// Should we set a custom font size?
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
if (sp.getBoolean(SettingsActivity.PREF_CUSTOM_FONT, false)) {
etName.setTextSize(Float.parseFloat(sp.getString(SettingsActivity.PREF_CUTSOM_FONT_SIZE, "15")));
}

//CategorySpinner
Cursor c = DbAccess.getCategories(getBaseContext());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ private void loadActivity(boolean initial){
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
if (sp.getBoolean(SettingsActivity.PREF_CUSTOM_FONT, false)) {
etContent.setTextSize(Float.parseFloat(sp.getString(SettingsActivity.PREF_CUTSOM_FONT_SIZE, "15")));
etName.setTextSize(Float.parseFloat(sp.getString(SettingsActivity.PREF_CUTSOM_FONT_SIZE, "15")));
}

//CategorySpinner
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.secuso.privacyfriendlynotes.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -9,6 +11,7 @@
import android.widget.TextView;

import org.secuso.privacyfriendlynotes.R;
import org.secuso.privacyfriendlynotes.SettingsActivity;

import java.util.List;

Expand Down Expand Up @@ -39,6 +42,11 @@ public View getView(int position, View convertView, ViewGroup parent) {

checkBox.setChecked(item.isChecked());
textView.setText(item.getName());
// Should we set a custom font size?
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getContext());
if (sp.getBoolean(SettingsActivity.PREF_CUSTOM_FONT, false)) {
textView.setTextSize(Float.parseFloat(sp.getString(SettingsActivity.PREF_CUTSOM_FONT_SIZE, "15")));
}
}

return v;
Expand Down

0 comments on commit 6ca3afb

Please sign in to comment.