Commit 10dd1118 authored by DNLDsht's avatar DNLDsht

clean

parent 81d42ec4
......@@ -4,7 +4,6 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
......@@ -27,6 +26,14 @@ android {
versionCode 1
versionName "1.0"
}
defaultConfig {
generatedDensities = []
}
// This is handled for you by the 2.0+ Gradle Plugin
aaptOptions {
additionalParameters "--no-version-vectors"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
......@@ -37,8 +44,6 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
......
......@@ -58,7 +58,7 @@ public class PhotosActivity extends ThemedActivity {
HandlingAlbums albums = new HandlingAlbums(PhotosActivity.this);
CustomAlbumsHandler customAlbumsHandler = new CustomAlbumsHandler(PhotosActivity.this);
HandlingPhotos photos;
SharedPreferences SP;
CollapsingToolbarLayout collapsingToolbarLayout;
Toolbar toolbar;
ImageView headerImage;
......@@ -533,20 +533,11 @@ public class PhotosActivity extends ThemedActivity {
public void initUiTweaks() {
if (isNavigationBarColored())
getWindow().setNavigationBarColor(getPrimaryColor());
else getWindow().setNavigationBarColor(ContextCompat.getColor(getApplicationContext(), R.color.md_black_1000));
SP = PreferenceManager.getDefaultSharedPreferences(PhotosActivity.this);
/**** Status Bar */
Window window = getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
applyTheme();
setStatusBarTranslucent(false);
getWindow().setStatusBarColor(Color.TRANSPARENT);
/**** ToolBar*/
toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
......@@ -563,13 +554,11 @@ public class PhotosActivity extends ThemedActivity {
public void onClick(View v) {
Intent i = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
startActivity(i);
}
});
collapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
collapsingToolbarLayout.setStatusBarScrimColor(getPrimaryColor());
AppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.app_bar_layout);
if(thereIsCollapsing()){
appBarLayout.setExpanded(true, true);
......@@ -618,19 +607,4 @@ public class PhotosActivity extends ThemedActivity {
getWindow().setEnterTransition(transition);
getWindow().setReturnTransition(transition);
}
protected void setStatusBarTranslucent(boolean makeTranslucent) {
if (makeTranslucent)
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
else
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
/*
@Override
public void onBackPressed(){
super.onBackPressed();
overridePendingTransition(R.anim.comming_in, R.anim.comming_out);
}
*/
}
......@@ -75,9 +75,8 @@ public class SelectAlbumActivity extends ThemedActivity{
onBackPressed();
}
});
getWindow().setStatusBarColor(getPrimaryColor());
/*FAB*/
final FloatingActionButton fabhidden = (FloatingActionButton) findViewById(R.id.fab_hidden);
......@@ -90,16 +89,11 @@ public class SelectAlbumActivity extends ThemedActivity{
});
loadAlbumPreview();
//Base Theme
LinearLayout ll = (LinearLayout) findViewById(R.id.select_album_layout);
if (isDarkTheme())
ll.setBackgroundColor(ContextCompat.getColor(getApplicationContext(),R.color.act_bg_dark));
else ll.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.act_bg_light));
ll.setBackgroundColor(getBackgroundColor());
if (isNavigationBarColored())
getWindow().setNavigationBarColor(getPrimaryColor());
else getWindow().setNavigationBarColor(ContextCompat.getColor(getApplicationContext(), R.color.md_black_1000));
applyTheme();
setRecentApp(getString(R.string.app_name));
}
......
......@@ -7,6 +7,7 @@ import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.view.WindowManager;
import com.leafpic.app.utils.ColorPalette;
import com.leafpic.app.R;
......@@ -48,6 +49,20 @@ public class ThemedActivity extends AppCompatActivity {
if(darkTheme) return ColorPalette.getDarkBackgroundColor(getApplicationContext());
else return ColorPalette.getLightBackgroundColor(getApplicationContext());
}
public int getTextColor(){
if(darkTheme) return ColorPalette.getDarkTextColor(getApplicationContext());
else return ColorPalette.getLightTextColor(getApplicationContext());
}
public void applyTheme() {
if (isNavigationBarColored())
getWindow().setNavigationBarColor(getPrimaryColor());
else getWindow().setNavigationBarColor(ContextCompat.getColor(getApplicationContext(), R.color.md_black_1000));
getWindow().setStatusBarColor(getPrimaryColor());
}
@Override
public void onResume(){
super.onResume();
......@@ -61,6 +76,13 @@ public class ThemedActivity extends AppCompatActivity {
updateTheme();
}
protected void setStatusBarTranslucent(boolean makeTranslucent) {
if (makeTranslucent)
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
else
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
public void updateTheme(){
this.primaryColor = SP.getInt("primary_color", ContextCompat.getColor(getApplicationContext(),R.color.accent_blue));//TEAL CARD BG DEFAULT;
this.accentColor = SP.getInt("accent_color",ContextCompat.getColor(getApplicationContext(),R.color.accent_green));//TEAL COLOR DEFAULT
......
......@@ -36,6 +36,14 @@ public class ColorPalette {
return ContextCompat.getColor(context, R.color.act_bg_light);
}
public static int getDarkTextColor(Context context){
return ContextCompat.getColor(context, R.color.cp_TextDark);
}
public static int getLightTextColor(Context context){
return ContextCompat.getColor(context, R.color.cp_TextLight);
}
public static int[] getBaseColors(Context context) {
return new int[]{
ContextCompat.getColor(context, R.color.md_red_500),
......
......@@ -12,6 +12,7 @@
android:layout_height="140dp"
android:id="@+id/Drawer_Header"
android:clickable="true"
android:elevation="4dp"
>
<TextView
android:layout_width="match_parent"
......@@ -21,7 +22,7 @@
android:gravity="center"
android:textStyle="bold|italic"
android:textSize="50sp"
android:textColor="@color/md_dark_background"
android:textColor="@color/md_white_1000"
/>
<!--
<ImageView
......
......@@ -11,6 +11,7 @@ buildscript {
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment