rename article pager and related stuff to gallery

This commit is contained in:
Andrew Dolgov 2017-06-02 14:51:11 +03:00
parent 0f764c3f61
commit 6f1afb1ef0
8 changed files with 13 additions and 36 deletions

View File

@ -248,7 +248,7 @@
</service>
<activity
android:name=".ArticleImagesPagerActivity"
android:name=".GalleryActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="Article Images" >
</activity>

View File

@ -1,8 +1,5 @@
package org.fox.ttrss;
import android.annotation.SuppressLint;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
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.view.ViewPager;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.ContextMenu;
import android.view.View;
import android.widget.ProgressBar;
import com.ToxicBakery.viewpager.transforms.DepthPageTransformer;
import com.bumptech.glide.Glide;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
@ -27,11 +22,8 @@ import org.jsoup.select.Elements;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
import me.relex.circleindicator.CircleIndicator;
public class ArticleImagesPagerActivity extends CommonActivity {
public class GalleryActivity extends CommonActivity {
private final String TAG = this.getClass().getSimpleName();
private ArrayList<GalleryEntry> m_items;
@ -73,7 +65,7 @@ public class ArticleImagesPagerActivity extends CommonActivity {
switch (item.type) {
case TYPE_IMAGE:
if (true) {
ArticleImageFragment frag = new ArticleImageFragment();
GalleryImageFragment frag = new GalleryImageFragment();
frag.initialize(item.url);
return frag;
@ -81,7 +73,7 @@ public class ArticleImagesPagerActivity extends CommonActivity {
break;
case TYPE_VIDEO:
if (true) {
ArticleVideoFragment frag = new ArticleVideoFragment();
GalleryVideoFragment frag = new GalleryVideoFragment();
frag.initialize(item.url, item.coverUrl);
return frag;
@ -111,7 +103,7 @@ public class ArticleImagesPagerActivity extends CommonActivity {
position++;
try {
Bitmap bmp = Glide.with(ArticleImagesPagerActivity.this)
Bitmap bmp = Glide.with(zzzzticleImagesPagerActivity.this)
.load(url)
.asBitmap()
.into(-1, -1)
@ -177,7 +169,7 @@ public class ArticleImagesPagerActivity extends CommonActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.article_images_pager);
setContentView(R.layout.activity_gallery);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

View File

@ -9,7 +9,7 @@ import android.view.MenuItem;
public class GalleryBaseFragment extends Fragment {
private final String TAG = this.getClass().getSimpleName();
protected ArticleImagesPagerActivity m_activity;
protected GalleryActivity m_activity;
@Override
public void onCreate(Bundle savedInstanceState) {
@ -56,7 +56,7 @@ public class GalleryBaseFragment extends Fragment {
super.onAttach(activity);
//m_prefs = PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext());
m_activity = (ArticleImagesPagerActivity) activity;
m_activity = (GalleryActivity) activity;
}

View File

@ -1,10 +1,7 @@
package org.fox.ttrss;
import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewCompat;
import android.util.Log;
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.Target;
public class ArticleImageFragment extends GalleryBaseFragment {
public class GalleryImageFragment extends GalleryBaseFragment {
private final String TAG = this.getClass().getSimpleName();
String m_url;
@Override
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) {
m_url = savedInstanceState.getString("url");

View File

@ -1,15 +1,11 @@
package org.fox.ttrss;
import android.app.Activity;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.graphics.SurfaceTexture;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewCompat;
import android.util.Log;
import android.view.Display;
@ -17,18 +13,13 @@ import android.view.LayoutInflater;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.TextureView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.MediaController;
import android.widget.PopupMenu;
import android.widget.ProgressBar;
import com.bogdwellers.pinchtozoom.ImageMatrixTouchHandler;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
@ -38,7 +29,7 @@ import com.bumptech.glide.request.target.Target;
import java.io.IOException;
public class ArticleVideoFragment extends GalleryBaseFragment {
public class GalleryVideoFragment extends GalleryBaseFragment {
private final String TAG = this.getClass().getSimpleName();
String m_url;
@ -48,7 +39,7 @@ public class ArticleVideoFragment extends GalleryBaseFragment {
@Override
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) {
m_url = savedInstanceState.getString("url");

View File

@ -42,7 +42,6 @@ import android.view.LayoutInflater;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.TextureView;
import android.view.View;
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.HeadlinesRequest;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@ -1503,7 +1500,7 @@ public class HeadlinesFragment extends Fragment {
} 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("title", article.title);