• 大小: 333KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-06-05
  • 语言: Html/CSS
  • 标签: textview  

资源简介

textview完美展示html格式代码,包括图片大小自定义,点击浏览等;textview完美展示html格式代码,包括图片大小自定义,点击浏览等;

资源截图

代码片段和文件信息

package byl.com.testprasehtml;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.target.Target;

import java.util.List;

public class ImgPreviewActivity extends AppCompatActivity {

    ViewPager vp;
    TextView tv_position;
    List imgList;
    int mPosition;
    LayoutInflater inflater;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_img_page);
        Bundle b = getIntent().getBundleExtra(“b“);
        imgList = b.getStringArrayList(“imglist“);
        mPosition=b.getInt(“position“);
        inflater = LayoutInflater.from(this);
        initView();
        initViewPaper();
    }

    private void initView() {
        vp = (ViewPager) findViewById(R.id.vp);
        tv_position = (TextView) findViewById(R.id.tv_position);
        tv_position.setText((mPosition+1)+“/“ + imgList.size());
    }

    private void initViewPaper() {
        vp.setAdapter(new ImagePagerAdapter(imgList));
        vp.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
            @Override
            public void onPageScrolled(int position float positionOffset int positionOffsetPixels) {

            }

            @Override
            public void onPageSelected(int position) {
                mPosition = position;
                tv_position.setText((mPosition + 1) + “/“ + imgList.size());
            }

            @Override
            public void onPageScrollStateChanged(int state) {

            }
        });
        vp.setCurrentItem(mPosition);
    }

    private class ImagePagerAdapter extends PagerAdapter {

        private List images;
        private LayoutInflater inflater;

        ImagePagerAdapter(List images) {
            this.images = images;
            inflater = getLayoutInflater();
        }

        @Override
        public void destroyItem(ViewGroup container int position object object) {
            container.removeView((View) object);
        }

        @Override
        public int getCount() {
            return images.size();
        }

        @Override
        public object instantiateItem(ViewGroup view final int position) {
            View imageLayout = inflater.inflate(R.layout.item_pager_image view false);
            assert imageLayout != null;
            final ProgressBar progressBar = (ProgressBar) imageLayout.findViewById(R.id.loading);
            ImageView image = (ImageView) imageLayout.findViewByI

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        127  2016-12-08 15:58  TestPraseHtml\.gitignore

     文件         31  2016-12-08 15:58  TestPraseHtml\.gradle\2.14.1\taskArtifacts\cache.properties

     文件         17  2016-12-09 11:13  TestPraseHtml\.gradle\2.14.1\taskArtifacts\cache.properties.lock

     文件     285050  2016-12-09 11:13  TestPraseHtml\.gradle\2.14.1\taskArtifacts\fileHashes.bin

     文件    3864804  2016-12-09 11:13  TestPraseHtml\.gradle\2.14.1\taskArtifacts\fileSnapshots.bin

     文件      26546  2016-12-09 11:13  TestPraseHtml\.gradle\2.14.1\taskArtifacts\fileSnapshotsToTreeSnapshotsIndex.bin

     文件     105362  2016-12-09 11:13  TestPraseHtml\.gradle\2.14.1\taskArtifacts\taskArtifacts.bin

     文件     381854  2016-12-09 11:13  TestPraseHtml\.gradle\2.14.1\tasks\_app_compileDebugJavaWithJavac\localClassSetAnalysis\localClassSetAnalysis.bin

     文件         17  2016-12-09 11:13  TestPraseHtml\.gradle\2.14.1\tasks\_app_compileDebugJavaWithJavac\localClassSetAnalysis\localClassSetAnalysis.lock

     文件      20970  2016-12-09 11:13  TestPraseHtml\.gradle\2.14.1\tasks\_app_compileDebugJavaWithJavac\localJarClasspathSnapshot\localJarClasspathSnapshot.bin

     文件         17  2016-12-09 11:13  TestPraseHtml\.gradle\2.14.1\tasks\_app_compileDebugJavaWithJavac\localJarClasspathSnapshot\localJarClasspathSnapshot.lock

     文件          8  2016-12-08 15:58  TestPraseHtml\app\.gitignore

     文件       9296  2016-12-09 11:05  TestPraseHtml\app\app.iml

     文件        804  2016-12-09 11:05  TestPraseHtml\app\build.gradle

     文件      25606  2016-12-08 16:04  TestPraseHtml\app\libs\osbcp-css-parser-1.4.jar

     文件        970  2016-12-08 15:58  TestPraseHtml\app\proguard-rules.pro

     文件        808  2016-12-09 10:07  TestPraseHtml\app\src\main\AndroidManifest.xml

     文件       4327  2016-12-09 11:13  TestPraseHtml\app\src\main\java\byl\com\testprasehtml\ImgPreviewActivity.java

     文件       9134  2016-12-09 12:03  TestPraseHtml\app\src\main\java\byl\com\testprasehtml\MainActivity.java

     文件       2156  2016-02-14 22:58  TestPraseHtml\app\src\main\java\net\nightwhistler\htmlspanner\css\CompiledRule.java

     文件      20714  2016-12-08 16:00  TestPraseHtml\app\src\main\java\net\nightwhistler\htmlspanner\css\CSSCompiler.java

     文件        230  2016-02-14 22:58  TestPraseHtml\app\src\main\java\net\nightwhistler\htmlspanner\exception\ParsingCancelledException.java

     文件       1966  2016-02-14 22:58  TestPraseHtml\app\src\main\java\net\nightwhistler\htmlspanner\FontFamily.java

     文件        303  2016-12-08 16:00  TestPraseHtml\app\src\main\java\net\nightwhistler\htmlspanner\FontResolver.java

     文件       1821  2016-02-14 22:58  TestPraseHtml\app\src\main\java\net\nightwhistler\htmlspanner\handlers\attributes\AlignmentAttributeHandler.java

     文件       1301  2016-02-14 22:58  TestPraseHtml\app\src\main\java\net\nightwhistler\htmlspanner\handlers\attributes\BorderAttributeHandler.java

     文件       2014  2016-02-14 22:58  TestPraseHtml\app\src\main\java\net\nightwhistler\htmlspanner\handlers\attributes\styleAttributeHandler.java

     文件       1719  2016-02-14 22:58  TestPraseHtml\app\src\main\java\net\nightwhistler\htmlspanner\handlers\attributes\WrappingstyleHandler.java

     文件       2283  2016-02-14 22:58  TestPraseHtml\app\src\main\java\net\nightwhistler\htmlspanner\handlers\FontHandler.java

     文件       1959  2016-02-14 22:58  TestPraseHtml\app\src\main\java\net\nightwhistler\htmlspanner\handlers\HeaderHandler.java

............此处省略90个文件信息

评论

共有 条评论