Commit 6a6a3603 authored by DNLDsht's avatar DNLDsht

fuck jitpack ssl certicate!

+ clean
parent cfdac210
......@@ -58,6 +58,18 @@
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:name=".MainActivity"
android:label="Album"
android:parentActivityName=".PhotosActivity"
android:theme="@style/Theme.AppCompat.NoActionBar">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".PhotosActivity"/>
<intent-filter>
<action android:name="android.intent.action.albumPhoto"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
</manifest>
package com.leafpic.app.Adapters;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.ListFragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.leafpic.app.Base.Photo;
import com.leafpic.app.Fragments.ImageFragment;
import com.leafpic.app.R;
import java.util.ArrayList;
/**
* Created by dnld on 18/02/16.
*/
public class MyPagerAdapter extends FragmentPagerAdapter {
ArrayList<Photo> photos;
public MyPagerAdapter(FragmentManager fm, ArrayList<Photo> photos) {
super(fm);
this.photos=photos;
}
@Override
public Fragment getItem(int pos) {
return ImageFragment.newInstance(photos.get(pos).Path,0,0);
}
@Override
public int getCount() {
return photos.size();
}
}
\ No newline at end of file
package com.leafpic.app.Fragments;
import android.graphics.Bitmap;
import android.graphics.PointF;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.GestureDetector;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.animation.GlideAnimation;
import com.bumptech.glide.request.target.SimpleTarget;
import com.davemorrissey.labs.subscaleview.ImageSource;
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView;
import com.leafpic.app.MainActivity;
import com.leafpic.app.R;
import com.leafpic.app.utils.StringUtils;
/**
* Created by dnld on 18/02/16.
*/
public class ImageFragment extends Fragment {
// Store instance variables
private String path;
private int width;
private int height;
// newInstance constructor for creating fragment with arguments
public static ImageFragment newInstance(String path,int width,int height) {
ImageFragment fragmentFirst = new ImageFragment();
Bundle args = new Bundle();
args.putInt("width", width);
args.putInt("height", height);
args.putString("path", path);
fragmentFirst.setArguments(args);
return fragmentFirst;
}
// Store instance variables based on arguments passed
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
width = getArguments().getInt("width", 300);
height = getArguments().getInt("height", 300);
path = getArguments().getString("path");
}
// Inflate the view for the fragment based on layout XML
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.image_pager_item, container, false);
final SubsamplingScaleImageView picture = (SubsamplingScaleImageView) view.findViewById(R.id.media_view);
picture.recycle();
Glide.with(container.getContext())
.load(path)
.asBitmap()
.into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap bitmap, GlideAnimation anim) {
picture.setImage(ImageSource.bitmap(bitmap));
}
});
/* picture.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
return gestureDetector.onTouchEvent(event);
}
});*/
picture.setMaxScale(10);
return view;
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -106,7 +106,7 @@ public class PhotosActivity extends AppCompatActivity {
invalidateOptionsMenu();
} else {
photos.setCurrentPhoto(is.getTag().toString());
Intent intent = new Intent(PhotosActivity.this, PhotoActivity.class);
Intent intent = new Intent(PhotosActivity.this, MainActivity.class);
Bundle b = new Bundle();
b.putParcelable("album", photos);
intent.putExtras(b);
......
......@@ -2,7 +2,7 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
android:theme="@style/Theme.AppCompat"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
......
......@@ -22,29 +22,26 @@
<group android:enabled="true" android:checkableBehavior="single">
<item
android:id="@+id/name_sort_action"
android:checked="false"
android:title="by Name"
app:showAsAction="ifRoom"
app:showAsAction="never"
/>
<item
android:id="@+id/date_taken_sort_action"
android:title="by Date Taken"
app:showAsAction="ifRoom"
app:showAsAction="never"
/>
<item
android:id="@+id/size_sort_action"
android:title="by Size"
android:checked="false"
app:showAsAction="ifRoom"
app:showAsAction="never"
/>
</group>
<group android:checkableBehavior="all">
<item
android:id="@+id/ascending_sort_action"
android:title="Ascending"
android:checked="false"
app:showAsAction="ifRoom"
app:showAsAction="never"
/>
</group>
</menu>
......
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