This repository has been archived by the owner on Jun 1, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
282 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
app/src/main/java/me/ccrama/redditslide/Activities/SettingsFab.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package me.ccrama.redditslide.Activities; | ||
|
||
import android.app.ActivityManager; | ||
import android.graphics.drawable.BitmapDrawable; | ||
import android.os.Build; | ||
import android.os.Bundle; | ||
import android.support.v4.content.ContextCompat; | ||
import android.support.v7.widget.Toolbar; | ||
import android.view.Window; | ||
import android.widget.CheckBox; | ||
import android.widget.CompoundButton; | ||
|
||
import me.ccrama.redditslide.ColorPreferences; | ||
import me.ccrama.redditslide.R; | ||
import me.ccrama.redditslide.Reddit; | ||
import me.ccrama.redditslide.SettingValues; | ||
import me.ccrama.redditslide.Visuals.FontPreferences; | ||
import me.ccrama.redditslide.Visuals.Pallete; | ||
|
||
|
||
/** | ||
* Created by l3d00m on 11/13/2015. | ||
*/ | ||
public class SettingsFab extends BaseActivityNoAnim { | ||
|
||
|
||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
getTheme().applyStyle(new FontPreferences(this).getFontStyle().getResId(), true); | ||
getTheme().applyStyle(new ColorPreferences(this).getFontStyle().getBaseId(), true); | ||
setContentView(R.layout.activity_settings_fab); | ||
final Toolbar b = (Toolbar) findViewById(R.id.toolbar); | ||
b.setBackgroundColor(Pallete.getDefaultColor()); | ||
setSupportActionBar(b); | ||
getSupportActionBar().setTitle(R.string.settings_fab); | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | ||
Window window = getWindow(); | ||
window.setStatusBarColor(Pallete.getDarkerColor(Pallete.getDefaultColor())); | ||
SettingsFab.this.setTaskDescription(new ActivityManager.TaskDescription(getString(R.string.settings_fab), | ||
((BitmapDrawable) ContextCompat.getDrawable(getBaseContext(), R.drawable.ic_launcher)).getBitmap(), Pallete.getDefaultColor())); | ||
} | ||
|
||
CheckBox fab = (CheckBox) findViewById(R.id.fab_visible); | ||
fab.setChecked(Reddit.fab); | ||
fab.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { | ||
@Override | ||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { | ||
Reddit.fab = isChecked; | ||
SettingValues.prefs.edit().putBoolean("Fab", isChecked).apply(); | ||
} | ||
}); | ||
|
||
CheckBox fabType = (CheckBox) findViewById(R.id.fab_type); | ||
fabType.setChecked(Reddit.fabType == R.integer.FAB_DISMISS); | ||
fabType.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { | ||
@Override | ||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { | ||
if(isChecked){ | ||
Reddit.fabType = R.integer.FAB_DISMISS; | ||
SettingValues.prefs.edit().putInt("FabType", R.integer.FAB_DISMISS).apply(); | ||
} | ||
else{ | ||
Reddit.fabType = R.integer.FAB_POST; | ||
SettingValues.prefs.edit().putInt("FabType", R.integer.FAB_POST).apply(); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.