Commit 80e8776c authored by Gilbert Ndresaj's avatar Gilbert Ndresaj 💬

Sync

parent c815b0bc
......@@ -7,6 +7,7 @@ import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.provider.MediaStore;
import android.support.annotation.NonNull;
......@@ -60,8 +61,7 @@ public class AlbumsActivity extends AppCompatActivity {
initUiTweaks();
checkPermissions();
<<<<<<< HEAD
//APP INTRO STATS HEARE DIO CANE
//APPINTRO TREAD
Thread t = new Thread(new Runnable() {
@Override
public void run() {
......@@ -69,6 +69,7 @@ public class AlbumsActivity extends AppCompatActivity {
.getDefaultSharedPreferences(getBaseContext());
boolean isFirstStart = getPrefs.getBoolean("firstStart", true);
if (isFirstStart) {
//albums.loadPreviewHiddenAlbums();
Intent i = new Intent(AlbumsActivity.this, IntroActivity.class);
startActivity(i);
SharedPreferences.Editor e = getPrefs.edit();
......@@ -78,16 +79,6 @@ public class AlbumsActivity extends AppCompatActivity {
}
});
t.start();
//asd.LogStuff();
//asd.loadPhotos();
//asd.logPhotos();
//asd.logAlbums();
//asd.logDeletedPhotos();
=======
>>>>>>> refs/remotes/DNLDsht/master
}
@Override
......@@ -401,30 +392,30 @@ public class AlbumsActivity extends AppCompatActivity {
}
}
private void loadAlbums() {
Thread t = new Thread(new Runnable() {
@Override
public void run() {
SharedPreferences getPrefs = PreferenceManager
.getDefaultSharedPreferences(getBaseContext());
boolean isFirstStart = getPrefs.getBoolean("firstStart", true);
if (isFirstStart) {
//albums.loadPreviewHiddenAlbums();
Intent i = new Intent(AlbumsActivity.this, IntroActivity.class);
startActivity(i);
SharedPreferences.Editor e = getPrefs.edit();
e.putBoolean("firstStart", false);
e.apply();
}
}
});
t.start();
private Handler handler;
private void loadAlbums() {
if (hidden) {
//LOAD
/*
MaterialDialog.Builder builder = new MaterialDialog.Builder(this)
.title("Hidden Albums")
.content("Scaning for hidden media...")
.progress(true, 0)
.progressIndeterminateStyle(true);
final MaterialDialog dialog = builder.build();
runOnUiThread(new Runnable() {
@Override
public void run() {
dialog.show();
}
});
*/
albums.loadPreviewHiddenAlbums();
//albums.LogAlbums();
//string.showToast(AlbumsActivity.this, "1:ALBUM LETTI");
//dialog.dismiss();
}
else {
// db.updatePhotos();
......@@ -473,10 +464,7 @@ public class AlbumsActivity extends AppCompatActivity {
mRecyclerView.setAdapter(adapt);
mRecyclerView.setLayoutManager(new GridLayoutManager(this, 2));
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
<<<<<<< HEAD
=======
adapt.notifyDataSetChanged();
>>>>>>> refs/remotes/DNLDsht/master
}
}
......@@ -118,7 +118,6 @@ public class HandlingAlbums {
public void hideSelectedAlbums() {
for (Album selectedAlbum : selectedAlbums)
hideAlbum(selectedAlbum);
clearSelectedAlbums();
}
......@@ -199,7 +198,7 @@ public class HandlingAlbums {
}
}
public void loadPreviewHiddenAlbums() {
public boolean loadPreviewHiddenAlbums() {
HiddenPhotosHandler db = new HiddenPhotosHandler(context);
if (db.getPhotosCount() == 0)
db.loadHiddenALbums();
......@@ -209,6 +208,7 @@ public class HandlingAlbums {
dispAlbum.photos = db.getFirstPhotosByAlbum(dispAlbum.Path);
}
db.close();
return true;
}
public void unHideSelectedAlbums() {
......
......@@ -7,9 +7,14 @@ import android.support.annotation.NonNull;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.*;
import android.view.GestureDetector;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
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;
......@@ -28,7 +33,7 @@ public class PhotoActivity extends AppCompatActivity {
Toolbar toolbar;
boolean fullscreenmode;
boolean showToolBar;
@Override
public void onCreate(Bundle savedInstanceState) {
......@@ -86,9 +91,11 @@ public class PhotoActivity extends AppCompatActivity {
}
//DA FIXXARE
hideSystemUI();
showSystemUI();
hideSystemUI();
getSupportActionBar().hide();
showToolBar = true;
}
@Override
......@@ -189,11 +196,15 @@ public class PhotoActivity extends AppCompatActivity {
| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
| View.SYSTEM_UI_FLAG_IMMERSIVE);
toolbar.animate().translationY(-toolbar.getBottom()).setInterpolator(new AccelerateInterpolator()).start();
fullscreenmode = true;
}
private void showSystemUI() {
if(showToolBar==true) {
getSupportActionBar().show();
showToolBar=false;
}
toolbar.animate().translationY(getStatusBarHeight()).setInterpolator(new DecelerateInterpolator()).start();
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
......
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