Changes in default value.
This commit is contained in:
@ -40,7 +40,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(getLayoutResourceId());
|
||||
|
||||
switch(tinyDb.getInt("customFontId")) {
|
||||
switch(tinyDb.getInt("customFontId", -1)) {
|
||||
|
||||
case 0:
|
||||
FontsOverride.setDefaultFont(this, "DEFAULT", "fonts/roboto.ttf");
|
||||
|
@ -186,7 +186,7 @@ public class IssueDetailActivity extends BaseActivity {
|
||||
|
||||
Typeface myTypeface;
|
||||
|
||||
switch(tinyDb.getInt("customFontId")) {
|
||||
switch(tinyDb.getInt("customFontId", -1)) {
|
||||
|
||||
case 1:
|
||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getApplicationContext()).getAssets(), "fonts/manroperegular.ttf");
|
||||
|
@ -109,7 +109,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
toolbarTitle = toolbar.findViewById(R.id.toolbar_title);
|
||||
|
||||
switch(tinyDb.getInt("customFontId")) {
|
||||
switch(tinyDb.getInt("customFontId", -1)) {
|
||||
|
||||
case 0:
|
||||
myTypeface = Typeface.createFromAsset(getAssets(), "fonts/roboto.ttf");
|
||||
|
@ -59,7 +59,7 @@ public class OrganizationDetailActivity extends BaseActivity implements BottomSh
|
||||
|
||||
Typeface myTypeface;
|
||||
|
||||
switch(tinyDb.getInt("customFontId")) {
|
||||
switch(tinyDb.getInt("customFontId", -1)) {
|
||||
|
||||
case 0:
|
||||
myTypeface = Typeface.createFromAsset(getApplicationContext().getAssets(), "fonts/roboto.ttf");
|
||||
|
@ -93,7 +93,7 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
|
||||
|
||||
Typeface myTypeface;
|
||||
|
||||
switch(tinyDb.getInt("customFontId")) {
|
||||
switch(tinyDb.getInt("customFontId", -1)) {
|
||||
|
||||
case 0:
|
||||
myTypeface = Typeface.createFromAsset(getApplicationContext().getAssets(), "fonts/roboto.ttf");
|
||||
|
@ -84,7 +84,7 @@ public class RepoStargazersAdapter extends BaseAdapter {
|
||||
final TinyDB tinyDb = new TinyDB(mCtx);
|
||||
Typeface myTypeface;
|
||||
|
||||
switch(tinyDb.getInt("customFontId")) {
|
||||
switch(tinyDb.getInt("customFontId", -1)) {
|
||||
|
||||
case 0:
|
||||
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/roboto.ttf");
|
||||
|
@ -84,7 +84,7 @@ public class RepoWatchersAdapter extends BaseAdapter {
|
||||
final TinyDB tinyDb = new TinyDB(mCtx);
|
||||
Typeface myTypeface;
|
||||
|
||||
switch(tinyDb.getInt("customFontId")) {
|
||||
switch(tinyDb.getInt("customFontId", -1)) {
|
||||
|
||||
case 0:
|
||||
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/roboto.ttf");
|
||||
|
@ -86,7 +86,7 @@ public class TeamMembersByOrgAdapter extends BaseAdapter {
|
||||
final TinyDB tinyDb = new TinyDB(mCtx);
|
||||
Typeface myTypeface;
|
||||
|
||||
switch(tinyDb.getInt("customFontId")) {
|
||||
switch(tinyDb.getInt("customFontId", -1)) {
|
||||
|
||||
case 0:
|
||||
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/roboto.ttf");
|
||||
|
@ -59,7 +59,7 @@ public class ProfileFragment extends Fragment {
|
||||
|
||||
Typeface myTypeface;
|
||||
|
||||
switch(tinyDb.getInt("customFontId")) {
|
||||
switch(tinyDb.getInt("customFontId", -1)) {
|
||||
|
||||
case 0:
|
||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getContext()).getAssets(), "fonts/roboto.ttf");
|
||||
|
@ -171,6 +171,10 @@ public class TinyDB {
|
||||
return preferences.getInt(key, 0);
|
||||
}
|
||||
|
||||
public int getInt(String key, int defaultValue) {
|
||||
return preferences.getInt(key, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get parsed ArrayList of Integers from SharedPreferences at 'key'
|
||||
* @param key SharedPreferences key
|
||||
|
Reference in New Issue
Block a user