|
|
@@ -13,6 +13,7 @@ import android.support.v7.widget.RecyclerView;
|
|
|
import android.text.TextUtils;
|
|
|
import android.util.Log;
|
|
|
import android.view.KeyEvent;
|
|
|
+import android.view.LayoutInflater;
|
|
|
import android.view.MotionEvent;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
@@ -21,8 +22,10 @@ import android.webkit.WebChromeClient;
|
|
|
import android.webkit.WebSettings;
|
|
|
import android.webkit.WebView;
|
|
|
import android.webkit.WebViewClient;
|
|
|
+import android.widget.EditText;
|
|
|
import android.widget.FrameLayout;
|
|
|
import android.widget.ImageView;
|
|
|
+import android.widget.RelativeLayout;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.sheep.gamegroup.absBase.BaseActivity;
|
|
|
@@ -73,7 +76,7 @@ import static com.sheep.gamegroup.util.UMConfigUtils.Event.FIND_SHARE;
|
|
|
* Created by realicing on 2018/5/10.
|
|
|
* realicing@sina.com
|
|
|
*/
|
|
|
-public class ActFindInformation extends BaseActivity implements Action1<Integer> {
|
|
|
+public class ActArticle extends BaseActivity implements Action1<Integer> {
|
|
|
@Override
|
|
|
protected int getLayoutId() {
|
|
|
return R.layout.net_empty_fresh_list;
|
|
|
@@ -100,6 +103,10 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
|
|
|
View check_net_ll;
|
|
|
@BindView(R.id.view_list)
|
|
|
RecyclerView view_list;
|
|
|
+ @BindView(R.id.bottom)
|
|
|
+ RelativeLayout bottom;
|
|
|
+ //输入框
|
|
|
+ private EditText input_comment_input;
|
|
|
WebView webView;
|
|
|
|
|
|
@Override
|
|
|
@@ -113,7 +120,7 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
FIND_SHARE.onEvent("find_id", id);
|
|
|
- Jump2View.getInstance().tryShare(ActFindInformation.this, "find_share_url", "find_id", id);
|
|
|
+ Jump2View.getInstance().tryShare(ActArticle.this, "find_share_url", "find_id", id);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -159,6 +166,25 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ //底部可跳转到评论
|
|
|
+ private void initBottomCommentView(){
|
|
|
+ if(input_comment_input != null || article == null){//保证只初始化一次
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ LayoutInflater.from(SheepApp.getInstance()).inflate(R.layout.include_input_comment, bottom);
|
|
|
+ input_comment_input = bottom.findViewById(R.id.input_comment_input);
|
|
|
+ input_comment_input.setCursorVisible(false);
|
|
|
+ input_comment_input.setFocusable(false);
|
|
|
+ input_comment_input.setFocusableInTouchMode(false);
|
|
|
+ View.OnClickListener onClickListener;
|
|
|
+ bottom.setOnClickListener(onClickListener = new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View view) {
|
|
|
+ Jump2View.getInstance().goActFindInformationComment(ActArticle.this, article.getId());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ input_comment_input.setOnClickListener(onClickListener);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
public void initWebView() {
|
|
|
@@ -194,7 +220,7 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
|
|
|
|
|
|
@Override
|
|
|
public View getVideoLoadingProgressView() {
|
|
|
- FrameLayout frameLayout = new FrameLayout(ActFindInformation.this);
|
|
|
+ FrameLayout frameLayout = new FrameLayout(ActArticle.this);
|
|
|
frameLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
|
|
return frameLayout;
|
|
|
}
|
|
|
@@ -238,10 +264,10 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- ActFindInformation.this.getWindow().getDecorView();
|
|
|
+ ActArticle.this.getWindow().getDecorView();
|
|
|
|
|
|
FrameLayout decor = (FrameLayout) getWindow().getDecorView();
|
|
|
- fullscreenContainer = new FullscreenHolder(ActFindInformation.this);
|
|
|
+ fullscreenContainer = new FullscreenHolder(ActArticle.this);
|
|
|
fullscreenContainer.addView(view, COVER_SCREEN_PARAMS);
|
|
|
decor.addView(fullscreenContainer, COVER_SCREEN_PARAMS);
|
|
|
customView = view;
|
|
|
@@ -321,14 +347,14 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
|
|
|
TextView find_information_name = (TextView) itemView.findViewById(R.id.find_information_name);
|
|
|
TextView find_information_time = (TextView) itemView.findViewById(R.id.find_information_time);
|
|
|
TextView find_information_look = (TextView) itemView.findViewById(R.id.find_information_look);
|
|
|
- ViewUtil.setText(find_information_name, findItem.getTitle());
|
|
|
- ViewUtil.setText(find_information_time, String.format(Locale.CHINA, "发布时间:%s", TimeUtil.TimeStamp2Date(findItem.getCreated_at(), "yyyy-MM-dd HH:mm")));
|
|
|
- ViewUtil.setText(find_information_look, findItem.getClicks());
|
|
|
+ ViewUtil.setText(find_information_name, article.getTitle());
|
|
|
+ ViewUtil.setText(find_information_time, String.format(Locale.CHINA, "发布时间:%s", TimeUtil.TimeStamp2Date(article.getCreated_at(), "yyyy-MM-dd HH:mm")));
|
|
|
+ ViewUtil.setText(find_information_look, article.getClicks());
|
|
|
|
|
|
webView = itemView.findViewById(R.id.find_information_content_wb);
|
|
|
initWebView();
|
|
|
- CommonUtil.getInstance().setDownloadListener(ActFindInformation.this, webView);
|
|
|
- ViewUtil.loadDataWithBaseURL(webView, findItem.getContent());
|
|
|
+ CommonUtil.getInstance().setDownloadListener(ActArticle.this, webView);
|
|
|
+ ViewUtil.loadDataWithBaseURL(webView, article.getContent());
|
|
|
|
|
|
|
|
|
}
|
|
|
@@ -374,16 +400,11 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
|
|
|
itemView.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
- Jump2View.getInstance().goFindGame(ActFindInformation.this, findItem);
|
|
|
+ Jump2View.getInstance().goFindGame(ActArticle.this, article);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void initListener() {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
private List<String> list = ListUtil.emptyList();
|
|
|
|
|
|
@Override
|
|
|
@@ -429,16 +450,18 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
|
|
|
private void loadFindItem(Article data) {
|
|
|
if (data != null) {
|
|
|
taskHelper.clear();
|
|
|
- findItem = data;
|
|
|
+ article = data;
|
|
|
list.clear();
|
|
|
list.add("top");
|
|
|
list.add("bottom");
|
|
|
notifyDataSetChanged();
|
|
|
- if (findItem.getRelease_task_id() != 0) {//包含任务
|
|
|
- taskHelper.initAcceptedTask(ActFindInformation.this, findItem.getRelease_task_id());
|
|
|
+
|
|
|
+ initBottomCommentView();
|
|
|
+ if (article.getRelease_task_id() != 0) {//包含任务
|
|
|
+ taskHelper.initAcceptedTask(ActArticle.this, article.getRelease_task_id());
|
|
|
}
|
|
|
- if (findItem.getApplication_id() != 0) {//包含游戏
|
|
|
- initFindApp(findItem.getApplication_id());
|
|
|
+ if (article.getApplication_id() != 0) {//包含游戏
|
|
|
+ initFindApp(article.getApplication_id());
|
|
|
}
|
|
|
} else {
|
|
|
refresh.setRefreshing(false);
|
|
|
@@ -476,7 +499,7 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- private Article findItem;
|
|
|
+ private Article article;
|
|
|
|
|
|
private void notifyDataSetChanged() {
|
|
|
if (empty_view == null) {
|
|
|
@@ -671,7 +694,7 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
|
|
|
// webView = null;
|
|
|
}
|
|
|
super.onDestroy();
|
|
|
- ActFindInformation.this.finish();
|
|
|
+ ActArticle.this.finish();
|
|
|
}
|
|
|
|
|
|
@Override
|