rename article pager and related stuff to gallery
This commit is contained in:
parent
0f764c3f61
commit
6f1afb1ef0
@ -248,7 +248,7 @@
|
|||||||
</service>
|
</service>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".ArticleImagesPagerActivity"
|
android:name=".GalleryActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
android:label="Article Images" >
|
android:label="Article Images" >
|
||||||
</activity>
|
</activity>
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
package org.fox.ttrss;
|
package org.fox.ttrss;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.os.AsyncTask;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.support.v4.app.ActivityCompat;
|
import android.support.v4.app.ActivityCompat;
|
||||||
@ -11,13 +8,11 @@ import android.support.v4.app.FragmentManager;
|
|||||||
import android.support.v4.app.FragmentStatePagerAdapter;
|
import android.support.v4.app.FragmentStatePagerAdapter;
|
||||||
import android.support.v4.view.ViewPager;
|
import android.support.v4.view.ViewPager;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.ContextMenu;
|
import android.view.ContextMenu;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
|
|
||||||
import com.ToxicBakery.viewpager.transforms.DepthPageTransformer;
|
import com.ToxicBakery.viewpager.transforms.DepthPageTransformer;
|
||||||
import com.bumptech.glide.Glide;
|
|
||||||
|
|
||||||
import org.jsoup.Jsoup;
|
import org.jsoup.Jsoup;
|
||||||
import org.jsoup.nodes.Document;
|
import org.jsoup.nodes.Document;
|
||||||
@ -27,11 +22,8 @@ import org.jsoup.select.Elements;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
|
|
||||||
import me.relex.circleindicator.CircleIndicator;
|
public class GalleryActivity extends CommonActivity {
|
||||||
|
|
||||||
public class ArticleImagesPagerActivity extends CommonActivity {
|
|
||||||
private final String TAG = this.getClass().getSimpleName();
|
private final String TAG = this.getClass().getSimpleName();
|
||||||
|
|
||||||
private ArrayList<GalleryEntry> m_items;
|
private ArrayList<GalleryEntry> m_items;
|
||||||
@ -73,7 +65,7 @@ public class ArticleImagesPagerActivity extends CommonActivity {
|
|||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case TYPE_IMAGE:
|
case TYPE_IMAGE:
|
||||||
if (true) {
|
if (true) {
|
||||||
ArticleImageFragment frag = new ArticleImageFragment();
|
GalleryImageFragment frag = new GalleryImageFragment();
|
||||||
frag.initialize(item.url);
|
frag.initialize(item.url);
|
||||||
|
|
||||||
return frag;
|
return frag;
|
||||||
@ -81,7 +73,7 @@ public class ArticleImagesPagerActivity extends CommonActivity {
|
|||||||
break;
|
break;
|
||||||
case TYPE_VIDEO:
|
case TYPE_VIDEO:
|
||||||
if (true) {
|
if (true) {
|
||||||
ArticleVideoFragment frag = new ArticleVideoFragment();
|
GalleryVideoFragment frag = new GalleryVideoFragment();
|
||||||
frag.initialize(item.url, item.coverUrl);
|
frag.initialize(item.url, item.coverUrl);
|
||||||
|
|
||||||
return frag;
|
return frag;
|
||||||
@ -111,7 +103,7 @@ public class ArticleImagesPagerActivity extends CommonActivity {
|
|||||||
position++;
|
position++;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Bitmap bmp = Glide.with(ArticleImagesPagerActivity.this)
|
Bitmap bmp = Glide.with(zzzzticleImagesPagerActivity.this)
|
||||||
.load(url)
|
.load(url)
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
.into(-1, -1)
|
.into(-1, -1)
|
||||||
@ -177,7 +169,7 @@ public class ArticleImagesPagerActivity extends CommonActivity {
|
|||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.article_images_pager);
|
setContentView(R.layout.activity_gallery);
|
||||||
|
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
@ -9,7 +9,7 @@ import android.view.MenuItem;
|
|||||||
|
|
||||||
public class GalleryBaseFragment extends Fragment {
|
public class GalleryBaseFragment extends Fragment {
|
||||||
private final String TAG = this.getClass().getSimpleName();
|
private final String TAG = this.getClass().getSimpleName();
|
||||||
protected ArticleImagesPagerActivity m_activity;
|
protected GalleryActivity m_activity;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
@ -56,7 +56,7 @@ public class GalleryBaseFragment extends Fragment {
|
|||||||
super.onAttach(activity);
|
super.onAttach(activity);
|
||||||
|
|
||||||
//m_prefs = PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext());
|
//m_prefs = PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext());
|
||||||
m_activity = (ArticleImagesPagerActivity) activity;
|
m_activity = (GalleryActivity) activity;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
package org.fox.ttrss;
|
package org.fox.ttrss;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.ActivityCompat;
|
import android.support.v4.app.ActivityCompat;
|
||||||
import android.support.v4.app.Fragment;
|
|
||||||
import android.support.v4.view.ViewCompat;
|
import android.support.v4.view.ViewCompat;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@ -24,14 +21,14 @@ import com.bumptech.glide.request.RequestListener;
|
|||||||
import com.bumptech.glide.request.target.GlideDrawableImageViewTarget;
|
import com.bumptech.glide.request.target.GlideDrawableImageViewTarget;
|
||||||
import com.bumptech.glide.request.target.Target;
|
import com.bumptech.glide.request.target.Target;
|
||||||
|
|
||||||
public class ArticleImageFragment extends GalleryBaseFragment {
|
public class GalleryImageFragment extends GalleryBaseFragment {
|
||||||
private final String TAG = this.getClass().getSimpleName();
|
private final String TAG = this.getClass().getSimpleName();
|
||||||
|
|
||||||
String m_url;
|
String m_url;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(R.layout.fragment_article_image, container, false);
|
View view = inflater.inflate(R.layout.fragment_gallery_entry, container, false);
|
||||||
|
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
m_url = savedInstanceState.getString("url");
|
m_url = savedInstanceState.getString("url");
|
@ -1,15 +1,11 @@
|
|||||||
package org.fox.ttrss;
|
package org.fox.ttrss;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.SurfaceTexture;
|
import android.graphics.SurfaceTexture;
|
||||||
import android.media.MediaPlayer;
|
import android.media.MediaPlayer;
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
|
||||||
import android.support.v4.app.ActivityCompat;
|
import android.support.v4.app.ActivityCompat;
|
||||||
import android.support.v4.app.Fragment;
|
|
||||||
import android.support.v4.view.ViewCompat;
|
import android.support.v4.view.ViewCompat;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Display;
|
import android.view.Display;
|
||||||
@ -17,18 +13,13 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.Surface;
|
import android.view.Surface;
|
||||||
import android.view.SurfaceHolder;
|
|
||||||
import android.view.SurfaceView;
|
|
||||||
import android.view.TextureView;
|
import android.view.TextureView;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.FrameLayout;
|
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.MediaController;
|
import android.widget.MediaController;
|
||||||
import android.widget.PopupMenu;
|
import android.widget.PopupMenu;
|
||||||
import android.widget.ProgressBar;
|
|
||||||
|
|
||||||
import com.bogdwellers.pinchtozoom.ImageMatrixTouchHandler;
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||||
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
|
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
|
||||||
@ -38,7 +29,7 @@ import com.bumptech.glide.request.target.Target;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class ArticleVideoFragment extends GalleryBaseFragment {
|
public class GalleryVideoFragment extends GalleryBaseFragment {
|
||||||
private final String TAG = this.getClass().getSimpleName();
|
private final String TAG = this.getClass().getSimpleName();
|
||||||
|
|
||||||
String m_url;
|
String m_url;
|
||||||
@ -48,7 +39,7 @@ public class ArticleVideoFragment extends GalleryBaseFragment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
final View view = inflater.inflate(R.layout.fragment_article_image, container, false);
|
final View view = inflater.inflate(R.layout.fragment_gallery_entry, container, false);
|
||||||
|
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
m_url = savedInstanceState.getString("url");
|
m_url = savedInstanceState.getString("url");
|
@ -42,7 +42,6 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.Surface;
|
import android.view.Surface;
|
||||||
import android.view.SurfaceHolder;
|
|
||||||
import android.view.TextureView;
|
import android.view.TextureView;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
@ -76,8 +75,6 @@ import org.fox.ttrss.types.Feed;
|
|||||||
import org.fox.ttrss.util.HeaderViewRecyclerAdapter;
|
import org.fox.ttrss.util.HeaderViewRecyclerAdapter;
|
||||||
import org.fox.ttrss.util.HeadlinesRequest;
|
import org.fox.ttrss.util.HeadlinesRequest;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InterruptedIOException;
|
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -1503,7 +1500,7 @@ public class HeadlinesFragment extends Fragment {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Intent intent = new Intent(m_activity, ArticleImagesPagerActivity.class);
|
Intent intent = new Intent(m_activity, GalleryActivity.class);
|
||||||
|
|
||||||
intent.putExtra("firstSrc", article.flavorStreamUri != null ? article.flavorStreamUri : article.flavorImageUri);
|
intent.putExtra("firstSrc", article.flavorStreamUri != null ? article.flavorStreamUri : article.flavorImageUri);
|
||||||
intent.putExtra("title", article.title);
|
intent.putExtra("title", article.title);
|
||||||
|
0
org.fox.ttrss/src/main/res/layout/article_images_pager.xml → org.fox.ttrss/src/main/res/layout/activity_gallery.xml
Executable file → Normal file
0
org.fox.ttrss/src/main/res/layout/article_images_pager.xml → org.fox.ttrss/src/main/res/layout/activity_gallery.xml
Executable file → Normal file
Loading…
Reference in New Issue
Block a user