“替代方案”是什么;android:UseClearTextTraffic“;在android API级别29中?

“替代方案”是什么;android:UseClearTextTraffic“;在android API级别29中?,android,android-studio,android-layout,webview,androidx,Android,Android Studio,Android Layout,Webview,Androidx,我正在开发wordpress android应用程序,在android webview中加载wordpress帖子数据。我正在使用改造&jsonapi从我的Wordpress站点获取数据。我的应用程序在android API LEVEL 26中运行良好,但问题是我需要API 28+才能上传到google play store。我迁移到androidx API级别29。帖子没有被加载,显示ERR\u CLEARTEXT\u不被允许,所以我使用了“android:usesCleartextTraff

我正在开发wordpress android应用程序,在android webview中加载wordpress帖子数据。我正在使用
改造&jsonapi
从我的Wordpress站点获取数据。我的应用程序在android API LEVEL 26中运行良好,但问题是我需要API 28+才能上传到google play store。我迁移到androidx API级别29。帖子没有被加载,显示
ERR\u CLEARTEXT\u不被允许
,所以我使用了
“android:usesCleartextTraffic=true”
帖子正在加载,但问题是像
和&&&&&&&&&&&&&&&&&&&&&&&&&&–、&&&&&&&&&&&&&&&&&&。我只能在API级别26中使用
“android:usesCleartextTraffic=true”
,但它工作正常,没有任何错误。我正在为我的问题寻找解决方案,我在任何地方都没有找到令人满意的答案。我被困在这一点上了。因此,我正在尝试另一种方法,用于
“android:usesCleartextTraffic=true”
。我的应用程序中有“文本到语音”功能,它工作得非常好,我的意思是它阅读了整个帖子,这在android webview中是不可见的。请建议。请查找代码以供参考

这是我的postdetails活动

Postdetails.java

package ak.wp.meto.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import androidx.fragment.app.FragmentManager;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.text.Html;
import android.view.MenuItem;
import android.view.View;
import android.webkit.WebView;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import ak.wp.meto.R;
import ak.wp.meto.adapters.CommentsAdapter;
import ak.wp.meto.api.http.ApiUtils;
import ak.wp.meto.api.models.posts.post.CommentsAndReplies;
import ak.wp.meto.api.models.posts.post.PostDetails;
import ak.wp.meto.api.params.HttpParams;
import ak.wp.meto.data.constant.AppConstant;
import ak.wp.meto.data.sqlite.FavouriteDbController;
import ak.wp.meto.fragment.WriteACommentFragment;
import ak.wp.meto.listeners.ListItemClickListener;
import ak.wp.meto.models.FavouriteModel;
import ak.wp.meto.utility.ActivityUtils;
import ak.wp.meto.utility.AppUtils;
import ak.wp.meto.utility.TtsEngine;
import ak.wp.meto.webengine.WebEngine;
import ak.wp.meto.webengine.WebListener;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

public class PostDetailsActivity extends BaseActivity implements WriteACommentFragment.OnCompleteListener {

    // Variables
    private Activity mActivity;
    private Context mContext;

    // init views
    private RelativeLayout lytPostDetailsView, lytCommentDetails;
    private int clickedPostId;
    private ImageView imgPost;
    private TextView tvPostTitle, tvPostAuthor, tvPostDate, tvCommnentList;
    private WebView webView;
    private FloatingActionButton fabWriteAComment;
    private ImageButton imgBtnSpeaker, imgBtnFav, imgBtnShare;
    private PostDetails model = null;

    // Favourites view
    private List<FavouriteModel> favouriteList;
    private FavouriteDbController favouriteDbController;
    private boolean isFavourite = false;

    // Comments view
    private List<CommentsAndReplies> commentList;
    private List<CommentsAndReplies> zeroParentComments;
    List<CommentsAndReplies> onlyThreeComments;
    private int mPerPage = 5;
    private RecyclerView rvComments;
    private CommentsAdapter commentsAdapter = null;

    // Text to speech
    private TtsEngine ttsEngine;
    private boolean isTtsPlaying = false;
    private String ttsText;

    private WebEngine webEngine;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        initVar();
        initView();
        initFunctionality();
        initListener();
    }

    private void initVar() {
        mActivity = PostDetailsActivity.this;
        mContext = mActivity.getApplicationContext();

        // Favourites view
        favouriteList = new ArrayList<>();

        // Comments view
        commentList = new ArrayList<>();
        zeroParentComments = new ArrayList<>();
        onlyThreeComments = new ArrayList<>();

        Intent intent = getIntent();
        if (intent != null) {
            clickedPostId = getIntent().getIntExtra(AppConstant.BUNDLE_KEY_POST_ID, 0);
        }
    }

    private void initView() {
        setContentView(R.layout.activity_post_details);

        lytPostDetailsView = (RelativeLayout) findViewById(R.id.lyt_post_details);
        lytCommentDetails = (RelativeLayout) findViewById(R.id.lyt_comment_list);
        //lytParentView.setVisibility(View.GONE);

        imgPost = (ImageView) findViewById(R.id.post_img);
        tvPostTitle = (TextView) findViewById(R.id.title_text);
        tvPostAuthor = (TextView) findViewById(R.id.post_author);
        tvPostDate = (TextView) findViewById(R.id.date_text);
        imgBtnSpeaker = (ImageButton) findViewById(R.id.imgBtnSpeaker);
        imgBtnFav = (ImageButton) findViewById(R.id.imgBtnFavourite);
        imgBtnShare = (ImageButton) findViewById(R.id.imgBtnShare);

        initWebEngine();


        tvCommnentList = (TextView) findViewById(R.id.comment_count);
        fabWriteAComment = (FloatingActionButton) findViewById(R.id.fab_new_comment);

        rvComments = (RecyclerView) findViewById(R.id.rvComments);
        rvComments.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));

        initLoader();

        initToolbar();
        enableBackButton();

    }

    public void initWebEngine() {

        webView = (WebView) findViewById(R.id.web_view);
        webEngine = new WebEngine(webView, mActivity);
        webEngine.initWebView();
        webEngine.initListeners(new WebListener() {
            @Override
            public void onStart() {
                initLoader();
            }

            @Override
            public void onLoaded() {
                hideLoader();
            }

            @Override
            public void onProgress(int progress) {
            }

            @Override
            public void onNetworkError() {
                showEmptyView();
            }

            @Override
            public void onPageTitle(String title) {
            }
        });
    }

    private void initFunctionality() {

        favouriteDbController = new FavouriteDbController(mContext);
        favouriteList.addAll(favouriteDbController.getAllData());
        for (int i = 0; i < favouriteList.size(); i++) {
            if (favouriteList.get(i).getPostId() == clickedPostId) {
                isFavourite = true;
                break;
            }
        }

        ttsEngine = new TtsEngine(mActivity);

        commentsAdapter = new CommentsAdapter(mActivity, (ArrayList) commentList, (ArrayList) onlyThreeComments);
        rvComments.setAdapter(commentsAdapter);

        showLoader();
        loadPostDetails();

        // show full-screen ads
        // AdUtils.getInstance(mContext).showFullScreenAd();

    }

    public void setFavImage() {
        if (isFavourite) {
            imgBtnFav.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_book));
        } else {
            imgBtnFav.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_un_book));
        }
    }

    public void initListener() {

        imgBtnSpeaker.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (model != null) {
                    toggleTtsPlay();
                }
            }
        });

        imgBtnFav.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (model != null) {
                    isFavourite = !isFavourite;
                    if (isFavourite) {
                        String imgUrl = null;
                        if (model.getEmbedded().getWpFeaturedMedias().size() >= 1) {
                            imgUrl = model.getEmbedded().getWpFeaturedMedias().get(0).getMediaDetails().getSizes().getFullSize().getSourceUrl();
                        }
                        favouriteDbController.insertData(
                                model.getID().intValue(),
                                imgUrl,
                                model.getTitle().getRendered(),
                                model.getOldDate(),
                                model.getEmbedded().getWpTerms().get(0).get(0).getName()
                        );
                    } else {
                        favouriteDbController.deleteFav(clickedPostId);
                    }
                    setFavImage();
                }
            }
        });

        imgBtnShare.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (model != null) {
                    Intent sendIntent = new Intent();
                    sendIntent.setAction(Intent.ACTION_SEND);
                    sendIntent.putExtra(Intent.EXTRA_TEXT, model.getPageUrl());
                    sendIntent.setType("text/plain");
                    startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_to)));
                }
            }
        });

        commentsAdapter.setItemClickListener(new ListItemClickListener() {
            @Override
            public void onItemClick(int position, View view) {
                int id = view.getId();
                CommentsAndReplies clickedComment = zeroParentComments.get(position);
                switch (id) {
                    case R.id.list_item:
                        ActivityUtils.getInstance().invokeCommentDetails(mActivity, CommentDetailsActivity.class, (ArrayList) commentList, clickedPostId, clickedComment, false, false);
                        break;
                    case R.id.reply_text:
                        ActivityUtils.getInstance().invokeCommentDetails(mActivity, CommentDetailsActivity.class, (ArrayList) commentList, clickedPostId, clickedComment, true, false);
                        break;
                    default:
                        break;
                }
            }
        });

        tvCommnentList.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ActivityUtils.getInstance().invokeCommentList(mActivity,
                        CommentListActivity.class,
                        (ArrayList) commentList,
                        (ArrayList) zeroParentComments,
                        clickedPostId,
                        false);
            }
        });

        fabWriteAComment.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                FragmentManager manager = getSupportFragmentManager();
                WriteACommentFragment dialog = WriteACommentFragment.newInstance(clickedPostId, AppConstant.THIS_IS_COMMENT);
                dialog.show(manager, AppConstant.BUNDLE_KEY_DIALOG_FRAGMENT);
            }
        });
    }

    public void loadPostDetails() {
        ApiUtils.getApiInterface().getPostDetails(clickedPostId).enqueue(new Callback<PostDetails>() {
            @Override
            public void onResponse(Call<PostDetails> call, Response<PostDetails> response) {
                if (response.isSuccessful()) {
                    // bind data
                    model = response.body();
                    PostDetails m = model;
                    // visible parent view
                    lytPostDetailsView.setVisibility(View.VISIBLE);
                    // visible comments button
                    fabWriteAComment.setVisibility(View.VISIBLE);

                    loadCommentsAndReplies(model.getLinks().getRepliesList().get(0).getHref());

                    setFavImage();


                    tvPostTitle.setText(Html.fromHtml(model.getTitle().getRendered()));

                    String imgUrl = null;
                    if (model.getEmbedded().getWpFeaturedMedias().size() > 0) {
                        if (model.getEmbedded().getWpFeaturedMedias().get(0).getMediaDetails() != null) {
                            if (model.getEmbedded().getWpFeaturedMedias().get(0).getMediaDetails().getSizes().getFullSize().getSourceUrl() != null) {
                                imgUrl = model.getEmbedded().getWpFeaturedMedias().get(0).getMediaDetails().getSizes().getFullSize().getSourceUrl();
                            }
                        }
                    }

                    if (imgUrl != null) {
                        Glide.with(getApplicationContext())
                                .load(imgUrl)
                                .into(imgPost);
                    }

                    String author = null;
                    if (model.getEmbedded().getAuthors().size() >= 1) {
                        author = model.getEmbedded().getAuthors().get(0).getName();
                    }

                    if (author == null) {
                        author = getString(R.string.admin);
                    }
                    tvPostAuthor.setText(Html.fromHtml(author));

                    String oldDate = model.getOldDate();
                    String newDate = AppUtils.getFormattedDate(oldDate);

                    if (newDate != null) {
                        tvPostDate.setText(Html.fromHtml(newDate));
                    }

                    String contentText = model.getContent().getRendered();

                    ttsText = new StringBuilder(Html.fromHtml(model.getTitle().getRendered())).append(AppConstant.DOT).append(Html.fromHtml(model.getContent().getRendered())).toString();
                    webView.loadData(contentText, "text/html", "UTF-8"); //comment
                    contentText = new StringBuilder().append(AppConstant.CSS_PROPERTIES).append(contentText).toString();
                    webEngine.loadHtml(contentText);

                } else {
                    showEmptyView();
                }
            }

            @Override
            public void onFailure(Call<PostDetails> call, Throwable t) {
                t.printStackTrace();
                // hide common loader
                hideLoader();
                // show empty view
                showEmptyView();
            }
        });
    }

    public void loadCommentsAndReplies(final String commentsAndRepliesLink) {

        ApiUtils.getApiInterface().getCommentsAndReplies(commentsAndRepliesLink, mPerPage).enqueue(new Callback<List<CommentsAndReplies>>() {
            @Override
            public void onResponse(Call<List<CommentsAndReplies>> call, Response<List<CommentsAndReplies>> response) {
                if (response.isSuccessful()) {

                    int totalItems = Integer.parseInt(response.headers().get(HttpParams.HEADER_TOTAL_ITEM));
                    int totalPages = Integer.parseInt(response.headers().get(HttpParams.HEADER_TOTAL_PAGE));


                    if (totalPages > 1) {
                        mPerPage = mPerPage * totalPages;
                        loadCommentsAndReplies(commentsAndRepliesLink);

                    } else {
                        if (!commentList.isEmpty() || !zeroParentComments.isEmpty() || !onlyThreeComments.isEmpty()) {
                            commentList.clear();
                            zeroParentComments.clear();
                            onlyThreeComments.clear();
                        }

                        commentList.addAll(response.body());

                        lytCommentDetails.setVisibility(View.VISIBLE);

                        if (commentList.size() > 0) {
                            for (CommentsAndReplies commentsAndReplies : commentList) {
                                if (commentsAndReplies.getParent().intValue() == 0) {
                                    zeroParentComments.add(commentsAndReplies);
                                }
                            }

                            if (zeroParentComments.size() >= 3) {
                                for (int i = 0; i < 3; i++) {
                                    onlyThreeComments.add(zeroParentComments.get(i));
                                }
                            } else {
                                for (CommentsAndReplies commentsAndReplies : zeroParentComments) {
                                    onlyThreeComments.add(commentsAndReplies);
                                }
                            }
                            commentsAdapter.notifyDataSetChanged();
                            tvCommnentList.setText(String.format(getString(R.string.all_comment), commentList.size()));
                            tvCommnentList.setClickable(true);

                        } else {
                            tvCommnentList.setClickable(false);
                        }
                    }

                }
            }

            @Override
            public void onFailure(Call<List<CommentsAndReplies>> call, Throwable t) {
                showEmptyView();
                t.printStackTrace();
            }
        });
    }

    private void toggleTtsPlay() {
        if (isTtsPlaying) {
            ttsEngine.releaseEngine();
            isTtsPlaying = false;
        } else {
            ttsEngine.startEngine(ttsText);
            isTtsPlaying = true;
        }
        toggleTtsView();
    }

    private void toggleTtsView() {
        if (isTtsPlaying) {
            imgBtnSpeaker.setImageDrawable(getResources().getDrawable(R.drawable.ic_speaker_stop));
        } else {
            imgBtnSpeaker.setImageDrawable(getResources().getDrawable(R.drawable.ic_speaker));
        }
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            // Respond to the action bar's Up/Home button
            case android.R.id.home:
                finish();
                return true;
        }
        return super.onOptionsItemSelected(item);
    }

    @Override
    public void onBackPressed() {
        finish();
    }

    @Override
    protected void onStop() {
        super.onStop();
        ttsEngine.releaseEngine();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ttsEngine.releaseEngine();
        model = null;
    }

    @Override
    protected void onResume() {
        super.onResume();
        if (isTtsPlaying) {
            isTtsPlaying = false;
            imgBtnSpeaker.setImageDrawable(getResources().getDrawable(R.drawable.ic_speaker));
        }
    }

    @Override
    public void onComplete(Boolean isCommentSuccessful, CommentsAndReplies commentsAndReplies) {
        if (isCommentSuccessful) {
            loadCommentsAndReplies(model.getLinks().getRepliesList().get(0).getHref());
        }
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (resultCode != RESULT_OK) {
            return;
        }

        if (requestCode == AppConstant.REQUEST_CODE_COMMENT) {
            if (data == null) {
                return;
            }
            boolean isCommentSuccessful = CommentListActivity.wasCommentSuccessful(data);
            if (isCommentSuccessful) {
                loadCommentsAndReplies(model.getLinks().getRepliesList().get(0).getHref());
            }
        }
    }
}
包ak.wp.meto.activity;
导入android.app.Activity;
导入android.content.Context;
导入android.content.Intent;
导入android.os.Bundle;
导入com.google.android.material.floatingactionbutton.floatingactionbutton;
导入androidx.fragment.app.FragmentManager;
导入androidx.core.content.ContextCompat;
导入androidx.recyclerview.widget.LinearLayoutManager;
导入androidx.recyclerview.widget.recyclerview;
导入android.text.Html;
导入android.view.MenuItem;
导入android.view.view;
导入android.webkit.WebView;
导入android.widget.ImageButton;
导入android.widget.ImageView;
导入android.widget.RelativeLayout;
导入android.widget.TextView;
导入com.bumptech.glide.glide;
进口ak.wp.meto.R;
导入ak.wp.meto.adapters.CommentsAdapter;
导入ak.wp.meto.api.http.ApiUtils;
导入ak.wp.meto.api.models.posts.post.comments和回复;
导入ak.wp.meto.api.models.posts.post.PostDetails;
导入ak.wp.meto.api.params.HttpParams;
导入ak.wp.meto.data.constant.AppConstant;
导入ak.wp.meto.data.sqlite.favoritedbcontroller;
导入ak.wp.meto.fragment.WriteACommentFragment;
导入ak.wp.meto.listeners.ListItemClickListener;
导入ak.wp.meto.models.favoriteModel;
导入ak.wp.meto.utility.ActivityUtils;
导入ak.wp.meto.utility.AppUtils;
导入ak.wp.meto.utility.TtsEngine;
导入ak.wp.meto.webengine.webengine;
导入ak.wp.meto.webengine.WebListener;
导入java.io.IOException;
导入java.util.ArrayList;
导入java.util.List;
2.电话;;
2.回拨;
2.回应;;
公共类PostDetailsActivity扩展BaseActivity实现WriteCommentFragment.OnCompleteListener{
//变数
私人活动能力;
私有上下文;
//初始视图
私有相对论Layout LytPostDetails视图,lytCommentDetails;
私有int clicked posted;
私有图像查看imgPost;
私有文本视图tvPostTitle、tvPostAuthor、tvPostDate、TvCommentList;
私有网络视图;
私有浮动操作按钮FabWriteAction;
私有图像按钮imgBtnSpeaker、imgBtnFav、imgBtnShare;
私有PostDetails模型=null;
//收藏夹视图
私人名单收藏名单;
私有收藏夹控制器收藏夹控制器;
私有布尔值isfavorite=false;
//评论意见
私人名单;
私人名单和评论;
只列出评论;
专用int mPerPage=5;
私人回收服务评论;
private CommentsAdapter CommentsAdapter=null;
//文本到语音
私人TtsEngine TtsEngine;
私有布尔值isTtsPlaying=false;
私有字符串ttsText;
私有网络引擎;
@凌驾
创建时受保护的void(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
initVar();
initView();
初始化功能();
initListener();
}
私有void initVar(){
mActivity=PostDetailsActivity.this;
mContext=mActivity.getApplicationContext();
//收藏夹视图
FavoriteList=新的ArrayList();
//评论意见
commentList=新的ArrayList();
zeroParentComments=新的ArrayList();
onlyThreeComments=newarraylist();
Intent=getIntent();
if(intent!=null){
clickedPostId=getIntent().getIntExtra(AppConstant.BUNDLE\u KEY\u POST\u ID,0);
}
}
私有void initView(){
setContentView(R.layout.activity\u post\u详细信息);
lytPostDetailsView=(RelativeLayout)findViewById(R.id.lyt\u post\u details);
LytCommonDetails=(RelativeLayout)findViewById(R.id.lyt\u注释列表);
//lytParentView.setVisibility(View.GONE);
imgPost=(ImageView)findViewById(R.id.post\u img);
tvPostTitle=(TextView)findViewById(R.id.title\u text);
tvPostAuthor=(TextView)findViewById(R.id.post_author);
tvPostDate=(TextView)findViewById(R.id.date\u text);
imgBtnSpeaker=(图像按钮)findViewById(R.id.imgBtnSpeaker);
imgBtnFav=(ImageButton)findViewById(R.id.imgBtnFav);
imgBtnShare=(ImageButton)findViewById(R.id.imgBtnShare);
initWebEngine();
TvCommentList=(TextView)findViewById(R.id.comment\u count);
FabWriteComment=(FloatingActionButton)findViewById(R.id.fab\u new\u comment);
rvComments=(RecyclerView)findViewById(R.id.rvComments);
rvComments.setLayoutManager(新的LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false));
initLoader();
initToolbar();
enableBackButton();
}
public void initWebEngine(){
我们
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white"
    android:fitsSystemWindows="true">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/app_bar_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            app:expandedTitleMarginEnd="64dp"
            app:expandedTitleMarginStart="48dp"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

            <ImageView
                android:id="@+id/post_img"
                android:layout_width="match_parent"
                android:layout_height="@dimen/margin_250dp"
                android:fitsSystemWindows="true"
                android:scaleType="centerCrop"
                android:src="@color/white"
                app:layout_collapseMode="parallax" />

            <androidx.appcompat.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:layout_collapseMode="pin"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light">

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <ImageButton
                        android:id="@+id/imgBtnSpeaker"
                        android:layout_width="30dp"
                        android:layout_height="30dp"
                        android:layout_centerVertical="true"
                        android:layout_marginRight="10dp"
                        android:layout_toLeftOf="@id/imgBtnFavourite"
                        android:padding="5dp"
                        android:scaleType="centerInside"
                        android:src="@drawable/ic_speaker" />
                </RelativeLayout>

            </androidx.appcompat.widget.Toolbar>
        </com.google.android.material.appbar.CollapsingToolbarLayout>
    </com.google.android.material.appbar.AppBarLayout>

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">
            <include layout="@layout/content_post_details" />
            <include layout="@layout/content_comments" />
        </LinearLayout>

    </androidx.core.widget.NestedScrollView>
    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/fab_new_comment"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="@dimen/activity_vertical_margin"
        android:src="@drawable/ic_fab"
        android:visibility="gone" />
    <include layout="@layout/view_common_loader" />    </androidx.coordinatorlayout.widget.CoordinatorLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/lyt_post_details"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white"
    android:visibility="gone">

    <LinearLayout
        android:id="@+id/li_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="@dimen/margin_8dp"
        android:layout_marginTop="@dimen/margin_8dp"
        android:orientation="horizontal"
        android:weightSum="1">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/margin_20dp"
            android:layout_weight="0.5"
            android:gravity="center_vertical"
            android:padding="@dimen/margin_8dp">

            <ImageView
                android:id="@+id/author_image"
                android:layout_width="@dimen/margin_30dp"
                android:layout_height="@dimen/margin_30dp"
                android:background="@drawable/ic_author" />    
        </LinearLayout>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/margin_20dp"
            android:layout_weight="0.5"
            android:gravity="center_vertical"
            android:padding="@dimen/margin_8dp">
        </LinearLayout>

    </LinearLayout>

    <View
        android:id="@+id/viewDivider"
        android:layout_width="match_parent"
        android:layout_height="0.7dp"
        android:layout_below="@id/li_layout"
        android:layout_marginLeft="@dimen/margin_15dp"
        android:layout_marginRight="@dimen/margin_15dp"
        android:background="@color/toolbar_boarder" />

    <TextView
        android:id="@+id/title_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/viewDivider"
        android:layout_margin="@dimen/margin_8dp"
        android:textColor="@color/black"
        android:textSize="18sp"
        android:textStyle="bold"
        tools:text="This is sample text do yoy know that it supports multi-line" />

    <WebView
        android:id="@+id/web_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/title_text"
        android:layout_margin="@dimen/margin_8dp"
        android:paddingBottom="@dimen/margin_8dp" />

</RelativeLayout>