Commit b67a9aa4 authored by Gilbert Ndresaj's avatar Gilbert Ndresaj

Merge remote-tracking branch 'refs/remotes/DNLDsht/master'

parents bc0a6500 9e515bf8
......@@ -40,8 +40,8 @@ public class PhotosAdapter extends RecyclerView.Adapter<PhotosAdapter.ViewHolder
@Override
public void onBindViewHolder(PhotosAdapter.ViewHolder holder, int position) {
Photo f = photos.get(position);
Photo f = photos.get(position);
if (f.MIME.equals("image/gif")) {
Ion.with(holder.imageView.getContext())
......@@ -50,26 +50,26 @@ public class PhotosAdapter extends RecyclerView.Adapter<PhotosAdapter.ViewHolder
holder.gifIcon.setVisibility(View.VISIBLE);
} else {
holder.gifIcon.setVisibility(View.INVISIBLE);
Glide.with(holder.imageView.getContext())
.load(f.Path)
.asBitmap()
.centerCrop()
.placeholder(R.drawable.ic_empty)
.into(holder.imageView);
}
holder.path.setTag(f.Path);
if (f.isSelected()) {
holder.selectHolder.setVisibility(View.VISIBLE);
holder.imageView.setPadding(15, 15, 15, 15);
holder.imageView.setColorFilter(0x88000000, PorterDuff.Mode.SRC_ATOP);
} else {
holder.selectHolder.setVisibility(View.INVISIBLE);
holder.imageView.setPadding(0, 0, 0, 0);
holder.imageView.clearColorFilter();
}
}
public void setOnClickListener(View.OnClickListener lis) {
......@@ -90,6 +90,7 @@ public class PhotosAdapter extends RecyclerView.Adapter<PhotosAdapter.ViewHolder
ImageView imageView, selectHolder, gifIcon;
TextView path;
public ViewHolder(View itemView) {
super(itemView);
imageView = (ImageView) itemView.findViewById(R.id.pic);
......
......@@ -6,7 +6,6 @@ import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
import android.provider.MediaStore;
import com.leafpic.app.utils.StringUtils;
import java.io.File;
......@@ -239,13 +238,9 @@ public class HandlingPhotos implements Parcelable {
try {
File from = new File(olderPath);
File to = new File(StringUtils.getAlbumPathRenamed(olderPath, name));
String s[] = from.list(), dirPath = from.getAbsolutePath();
for (String paht : s) scanFile(new String[]{dirPath + "/" + paht});
scanFile(new String[]{from.getAbsolutePath()});
from.renameTo(to);
s = to.list();
dirPath = to.getAbsolutePath();
for (String paht : s) scanFile(new String[]{dirPath + "/" + paht});
scanFile(new String[]{to.getAbsolutePath()});
} catch (Exception e) {
e.printStackTrace();
......
......@@ -10,6 +10,7 @@ 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.text.InputType;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
......@@ -164,25 +165,22 @@ public class PhotoActivity extends AppCompatActivity {
return true;
case R.id.renamePhoto:
/*
new MaterialDialog.Builder(this)
.title("Rename Photo")
.inputType(InputType.TYPE_CLASS_TEXT)
.input(null, StringUtils.getPhotoNamebyPath(photos.getCurrentPhoto().Path), new MaterialDialog.InputCallback() {
@Override
public void onInput(MaterialDialog dialog, CharSequence input) {
albums.renameAlbum(photos.FolderPath, input.toString());
//onBackPressed();
//finish();
StringUtils.showToast(getApplicationContext(), "I have to fix this!");
photos.renamePhoto(photos.getCurrentPhoto().Path, String.valueOf(input));
// StringUtils.showToast(getApplicationContext(), "I have to fix this!");
}
}).show();
*/
break;
case R.id.Modify:
break;
case R.id.details:
/****DATA****/
Calendar cl = Calendar.getInstance();
cl.setTimeInMillis(Long.parseLong(StringUtils.getPhotoNamebyPath(photos.getCurrentPhoto().DateTaken))); //here your time in miliseconds
......
package com.leafpic.app;
import android.content.ContentResolver;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.database.Cursor;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.net.Uri;
......@@ -84,21 +82,6 @@ public class PhotosActivity extends AppCompatActivity {
});
*/
private long getVideoIdFromFilePath(String filePath,
ContentResolver contentResolver) {
long videoId;
Uri videosUri = MediaStore.Video.Media.getContentUri("internal");
String[] projection = {MediaStore.Images.ImageColumns._ID};
// TODO This will break if we have no matching item in the MediaStore.
Cursor cursor = contentResolver.query(videosUri, projection, MediaStore.Images.ImageColumns.DATA + " LIKE ?", new String[]{filePath}, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(projection[0]);
videoId = cursor.getLong(columnIndex);
cursor.close();
return videoId;
}
public void LoadPhotos() {
......
......@@ -113,9 +113,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/gridPhotos"
android:numColumns="3"
android:verticalSpacing="0dp"
android:horizontalSpacing="0dp"
android:clipToPadding="false"
android:background="@color/md_dark_background"
/>
......
......@@ -4,7 +4,8 @@
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_margin="2dp"
>
<ImageView
android:id="@+id/selectedPicIcon"
......@@ -36,8 +37,8 @@
<ImageView
android:id="@+id/pic"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:minHeight="120dp"
android:scaleType="fitXY"
android:scaleType="center"
/>
</FrameLayout>
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_columnSpan="2"
android:id="@+id/card_photo"
>
<ImageView
android:id="@+id/selectedPicIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:elevation="10dp"
android:src="@mipmap/ic_check_circle_white_18dp"
android:layout_gravity="top|end"
android:layout_margin="10dp"
/>
<ImageView
android:id="@+id/gifIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_marginStart="5dp"
android:layout_marginBottom="1dp"
android:elevation="10dp"
android:src="@mipmap/ic_gif_white_24dp"
android:layout_gravity="bottom|start"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/path"
android:visibility="invisible"
/>
<ImageView
android:id="@+id/pic"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="120dp"
android:scaleType="fitXY"
/>
</FrameLayout>
......@@ -26,14 +26,18 @@
app:showAsAction="ifRoom">
<menu>
<item
android:id="@+id/rotateDX"
android:title="Rotate DX" />
android:id="@+id/rotateDX"
android:title="Rotate right 90°"
android:icon="@mipmap/ic_rotate_right_white_24dp"/>
<item
android:id="@+id/rotateSX"
android:title="Rotate SX" />
android:id="@+id/rotateSX"
android:title="Rotate left 90°"
android:icon="@mipmap/ic_rotate_left_white_24dp"/>
<item
android:id="@+id/rotate180"
android:title="Rotate 180" />
android:id="@+id/rotate180"
android:title="Rotate 180°"
android:icon="@mipmap/ic_replay_white_24dp"/>
</menu>
</item>
<item
......@@ -57,9 +61,9 @@
app:showAsAction="never"
/>
<item
android:id="@+id/setting"
android:title="Setting"
app:showAsAction="never"
android:id="@+id/setting"
android:title="Settings"
app:showAsAction="never"
/>
......
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