Commit afcaede3 authored by Gilbert Ndresaj's avatar Gilbert Ndresaj 💬

Stable Version Synch

parent 814bf448
......@@ -10,11 +10,7 @@ import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
<<<<<<< HEAD
import android.os.Handler;
=======
import android.os.Environment;
>>>>>>> refs/remotes/DNLDsht/master
import android.preference.PreferenceManager;
import android.provider.MediaStore;
import android.support.annotation.NonNull;
......@@ -33,7 +29,6 @@ import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.afollestad.materialdialogs.DialogAction;
import com.afollestad.materialdialogs.MaterialDialog;
import com.afollestad.materialdialogs.folderselector.FolderChooserDialog;
......@@ -74,7 +69,6 @@ public class AlbumsActivity extends AppCompatActivity implements FolderChooserDi
SP = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
initUiTweaks();
checkPermissions();
//APPINTRO TREAD
Thread t = new Thread(new Runnable() {
@Override
......@@ -142,7 +136,6 @@ public class AlbumsActivity extends AppCompatActivity implements FolderChooserDi
)
.build();
final Drawer result = new DrawerBuilder()
.withActivity(this)
.withToolbar(toolbar)
......@@ -190,10 +183,7 @@ public class AlbumsActivity extends AppCompatActivity implements FolderChooserDi
}
})
.build();
addHiddenFolder_FABEvent();
}
public void addHiddenFolder_FABEvent() {
......@@ -447,7 +437,8 @@ public class AlbumsActivity extends AppCompatActivity implements FolderChooserDi
}
private void loadAlbums() {
<<<<<<< HEAD
addHiddenFolder_FABEvent();
if (hidden) {
//LOAD
/*
......@@ -465,60 +456,14 @@ public class AlbumsActivity extends AppCompatActivity implements FolderChooserDi
}
});
*/
albums.loadPreviewHiddenAlbums();
//string.showToast(AlbumsActivity.this, "1:ALBUM LETTI");
//dialog.dismiss();
=======
runOnUiThread(new Runnable() {
public void run() {
albums.loadPreviewHiddenAlbums();
}
});
Thread t = new Thread(new Runnable() {
@Override
public void run() {
SharedPreferences getPrefs = PreferenceManager
.getDefaultSharedPreferences(getBaseContext());
boolean isFirstStart = getPrefs.getBoolean("firstStart", true);
if (isFirstStart) {
Intent i = new Intent(AlbumsActivity.this, IntroActivity.class);
startActivity(i);
SharedPreferences.Editor e = getPrefs.edit();
e.putBoolean("firstStart", false);
e.apply();
}
}
});
t.start();
addHiddenFolder_FABEvent();
if (hidden) {
final MaterialDialog dialog = new MaterialDialog.Builder(AlbumsActivity.this)
.title("Loading")
.progress(true, 0)
.progressIndeterminateStyle(true)
.build();
dialog.show();
runOnUiThread(new Runnable() {
public void run() {
albums.loadPreviewHiddenAlbums();
//dialog.dismiss();
}
});
//albums.LogAlbums();
>>>>>>> refs/remotes/DNLDsht/master
//dialog.dismiss();
}
else {
// db.updatePhotos();
albums.loadPreviewAlbums();
}
......
......@@ -7,19 +7,11 @@ import android.support.annotation.NonNull;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
<<<<<<< HEAD
import android.view.GestureDetector;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
=======
import android.view.Menu;
import android.view.MenuItem;
>>>>>>> refs/remotes/DNLDsht/master
import android.view.View;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import com.afollestad.materialdialogs.DialogAction;
import com.afollestad.materialdialogs.MaterialDialog;
import com.leafpic.app.Adapters.PhotosPagerAdapter;
......@@ -40,61 +32,41 @@ public class PhotoActivity extends AppCompatActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_photo);
initUiTweaks();
try {
Bundle data = getIntent().getExtras();
photos = data.getParcelable("album");
photos.setContext(PhotoActivity.this);
mCustomPagerAdapter = new PhotosPagerAdapter(this, photos.photos);
mCustomPagerAdapter.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
toggleSystemUI();
}
});
mViewPager = (ViewPager) findViewById(R.id.pager);
mViewPager.setAdapter(mCustomPagerAdapter);
mViewPager.setCurrentItem(photos.getCurrentPhotoIndex());
mViewPager.setPageTransformer(true, new DepthPageTransformer());
mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {}
@Override
public void onPageSelected(int position) {
photos.setCurrentPhotoIndex(position);
}
public void onPageSelected(int position) {photos.setCurrentPhotoIndex(position);}
@Override
public void onPageScrollStateChanged(int state) {
}
public void onPageScrollStateChanged(int state) {}
});
} catch (Exception e) {
e.printStackTrace();
}
<<<<<<< HEAD
//DA FIXXARE
hideSystemUI();
=======
>>>>>>> refs/remotes/DNLDsht/master
}
@Override
......@@ -158,7 +130,6 @@ public class PhotoActivity extends AppCompatActivity {
}
public void initUiTweaks() {
/**** ToolBar ********/
toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
toolbar.setBackgroundColor(getColor(R.color.transparent_gray));
......@@ -169,7 +140,6 @@ public class PhotoActivity extends AppCompatActivity {
getWindow().setStatusBarColor(getColor(R.color.transparent_gray));
/**** Navigation Bar */
getWindow().setNavigationBarColor(getColor(R.color.transparent_gray));
new Thread(new Runnable() {
public void run() {
hideSystemUI();
......@@ -184,21 +154,6 @@ public class PhotoActivity extends AppCompatActivity {
}
private void hideSystemUI() {
<<<<<<< HEAD
// Set the IMMERSIVE flag.
// Set the content to appear under the system bars so that the content
// doesn't resize when the system bars hide and show.
//getSupportActionBar().hide();
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
| View.SYSTEM_UI_FLAG_IMMERSIVE);
toolbar.animate().translationY(-toolbar.getBottom()).setInterpolator(new AccelerateInterpolator()).start();
fullscreenmode = true;
=======
runOnUiThread(new Runnable() {
public void run() {
getWindow().getDecorView().setSystemUiVisibility(
......@@ -213,8 +168,6 @@ public class PhotoActivity extends AppCompatActivity {
fullscreenmode = true;
}
});
>>>>>>> refs/remotes/DNLDsht/master
}
private void showSystemUI() {
......@@ -229,7 +182,6 @@ public class PhotoActivity extends AppCompatActivity {
fullscreenmode = false;
}
});
}
public int getStatusBarHeight() {
......
......@@ -22,7 +22,12 @@ import android.support.v7.widget.Toolbar;
import android.text.Html;
import android.text.InputType;
import android.transition.Slide;
import android.view.*;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
......@@ -54,8 +59,6 @@ public class PhotosActivity extends AppCompatActivity {
boolean editmode = false;
PhotosAdapter adapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
......@@ -73,25 +76,22 @@ public class PhotosActivity extends AppCompatActivity {
super.onResume();
}
<<<<<<< HEAD
//Bitmap bitmap = ((BitmapDrawable) image.getDrawable()).getBitmap();
// Drawable b = new Drawable.createFromPath(photos.getPreviewAlbumImg());
//}.decode//.decodeFile(photos.getPreviewAlbumImg());
Palette.from(bitmap).generate(new Palette.PaletteAsyncListener() {
@Override
public void onGenerated(Palette palette) {
int primaryDark = getColor(R.color.toolbar);
int primary = getColor(R.color.toolbar);
collapsingToolbarLayout.setContentScrimColor(palette.getMutedColor(primary));
collapsingToolbarLayout.setStatusBarScrimColor(palette.getMutedColor(primary));
//collapsingToolbarLayout.setStatusBarScrimColor(palette.getDarkVibrantColor(primaryDark));
}
});
//PALETTE
//Bitmap bitmap = ((BitmapDrawable) image.getDrawable()).getBitmap();
// Drawable b = new Drawable.createFromPath(photos.getPreviewAlbumImg());
//}.decode//.decodeFile(photos.getPreviewAlbumImg());
/*
Palette.from(bitmap).generate(new Palette.PaletteAsyncListener() {
@Override
public void onGenerated(Palette palette) {
int primaryDark = getColor(R.color.toolbar);
int primary = getColor(R.color.toolbar);
collapsingToolbarLayout.setContentScrimColor(palette.getMutedColor(primary));
collapsingToolbarLayout.setStatusBarScrimColor(palette.getMutedColor(primary));
//collapsingToolbarLayout.setStatusBarScrimColor(palette.getDarkVibrantColor(primaryDark));
}
=======
>>>>>>> refs/remotes/DNLDsht/master
});
*/
public void LoadPhotos() {
......@@ -337,7 +337,6 @@ public class PhotosActivity extends AppCompatActivity {
File file = new File(f.Path);
files.add(Uri.fromFile(file));
}
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, files);
startActivity(intent);
break;
......@@ -375,7 +374,6 @@ public class PhotosActivity extends AppCompatActivity {
/**** Status Bar */
//getWindow().setStatusBarColor(getColor(R.color.status_bar));
Window window = getWindow();
//window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
......@@ -383,7 +381,6 @@ public class PhotosActivity extends AppCompatActivity {
setStatusBarTranslucent(true);
window.setStatusBarColor(getColor(R.color.toolbar));
/**** ToolBar*/
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
......@@ -406,7 +403,6 @@ public class PhotosActivity extends AppCompatActivity {
collapsingToolbarLayout.setTitle(photos.DisplayName);
collapsingToolbarLayout.setExpandedTitleGravity(Gravity.CENTER_HORIZONTAL);
collapsingToolbarLayout.setExpandedTitleColor(getColor(android.R.color.transparent));
collapsingToolbarLayout.setContentScrimColor(getColor(R.color.toolbar));
collapsingToolbarLayout.setStatusBarScrimColor(getColor(R.color.toolbar));
......
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<<<<<<< HEAD
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/Theme.AppCompat.NoActionBar"
android:orientation="vertical"
tools:context=".MainActivity"
android:background="@color/background_material_dark">
=======
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/Theme.AppCompat.NoActionBar"
android:orientation="vertical"
tools:context=".MainActivity"
android:background="@color/background_material_dark">
>>>>>>> refs/remotes/DNLDsht/master
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
......@@ -38,7 +29,6 @@
android:onClick="addFolder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:borderWidth="0dp"
app:elevation="40dp"
app:ico_color="@color/md_white_1000"
......
......@@ -2,8 +2,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".MainActivity"
>
tools:context=".MainActivity">
<item
android:id="@+id/endEditAlbumMode"
android:icon="@mipmap/ic_done_white_24dp"
......@@ -16,7 +15,6 @@
android:title="Camera"
app:showAsAction="ifRoom"
/>
<!-- Settings, should always be in the overflow -->
<item android:id="@+id/sort_action"
android:title="Sort"
......@@ -24,15 +22,12 @@
android:icon="@mipmap/ic_sort_white_24dp"
app:showAsAction="ifRoom"
/>
<item
android:id="@+id/deleteAction"
android:icon="@mipmap/ic_delete_white_24dp"
android:title="@string/delete_album_action"
app:showAsAction="never"
/>
<item
android:id="@+id/excludeAlbumButton"
android:title="@string/exclude_album_action"
......@@ -43,11 +38,9 @@
android:title="@string/hide_album_action"
app:showAsAction="never"
/>
<item
android:id="@+id/refreshhiddenAlbumsButton"
android:title="@string/refresh_hidde_folders_action"
app:showAsAction="never"
/>
</menu>
\ No newline at end of file
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