diff options
author | Renard | 2016-04-11 17:50:06 -0300 |
---|---|---|
committer | Renard | 2016-04-11 17:50:06 -0300 |
commit | 90ee611af8ba4c38e70f27eb0df55e9134ad625c (patch) | |
tree | b5ed275f543b592cdb5658e732b75c98b3cae593 /app/src/main/java/layout/FragmentImage.java | |
parent | f90f14e5de8effc68a40029066754de1954cb65d (diff) | |
download | BaiApp-90ee611af8ba4c38e70f27eb0df55e9134ad625c.tar.gz BaiApp-90ee611af8ba4c38e70f27eb0df55e9134ad625c.tar.xz BaiApp-90ee611af8ba4c38e70f27eb0df55e9134ad625c.zip |
New ViewActivity, ThemeManager
Diffstat (limited to 'app/src/main/java/layout/FragmentImage.java')
-rw-r--r-- | app/src/main/java/layout/FragmentImage.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/app/src/main/java/layout/FragmentImage.java b/app/src/main/java/layout/FragmentImage.java index 399e9f3..f337e5f 100644 --- a/app/src/main/java/layout/FragmentImage.java +++ b/app/src/main/java/layout/FragmentImage.java @@ -2,6 +2,7 @@ package layout; import android.content.Context; import android.content.ContextWrapper; +import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; @@ -9,8 +10,9 @@ import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.Button; import android.widget.ProgressBar; -import android.widget.TextView; +import android.widget.RelativeLayout; import com.davemorrissey.labs.subscaleview.ImageSource; import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView; @@ -19,7 +21,6 @@ import com.koushikdutta.ion.Ion; import org.bienvenidoainternet.baiparser.R; import org.bienvenidoainternet.baiparser.ViewerActivity; -import org.bienvenidoainternet.baiparser.structure.BoardItem; import org.bienvenidoainternet.baiparser.structure.BoardItemFile; import java.io.File; @@ -80,11 +81,24 @@ public class FragmentImage extends Fragment { gifView = (GifImageView) view.findViewById(R.id.gifView); imageView.setVisibility(View.GONE); gifView.setVisibility(View.GONE); + RelativeLayout layoutOpenBrowser = (RelativeLayout) view.findViewById(R.id.layoutOpenBrowser); if (boardItemFile.file != null) { if (!boardItemFile.file.endsWith(".webm") && !boardItemFile.file.endsWith(".swf")) { + layoutOpenBrowser.setVisibility(View.GONE); downloadFile(); + }else{ + layoutOpenBrowser.setVisibility(View.VISIBLE); } } + Button btnOpenBrowser = (Button) view.findViewById(R.id.btnLaunchBrowser); + btnOpenBrowser.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent in = new Intent(Intent.ACTION_VIEW, Uri.parse(boardItemFile.fileURL)); + in.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + v.getContext().startActivity(in); + } + }); return view; } |