@Override public void OnRTMPCHttpFailed(int code) { if (listLive == null){ mRecyclerView.setBackgroundResource(R.drawable.has_no_msg); } } };
@Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { recyclerView = new RecyclerView(getContext()); recyclerView.setBackgroundResource(R.color.gray_light_background); LinearLayout rootView = new LinearLayout(getContext()); rootView.addView(recyclerView, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); return rootView; }
@Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { recyclerView = new RecyclerView(getContext()); recyclerView.setBackgroundResource(R.color.gray_light_background); LinearLayout rootView = new LinearLayout(getContext()); rootView.addView(recyclerView, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); return rootView; }
@Override protected void fillData(BGAViewHolderHelper bgaViewHolderHelper, int i, LiveItemBean livesBean) { if (livesBean != null) { recyclerView.setBackgroundResource(R.color.white); bgaViewHolderHelper.setText(R.id.txt_live_name, mContext.getString(R.string.theme_input) + livesBean.getmLiveTopic()); if (livesBean.getmMemNumber() != 0) { bgaViewHolderHelper.setText(R.id.txt_live_number, mContext.getString(R.string.peoples) + livesBean.getmMemNumber()); } else { bgaViewHolderHelper.setText(R.id.txt_live_number, ""); } } else { recyclerView.setBackgroundResource(R.drawable.has_no_msg); } } }
public void refreshUI() { TypedValue headerBackground = new TypedValue(); TypedValue navdrawerBackground = new TypedValue(); TypedValue navdrawerTextColor = new TypedValue(); Resources.Theme theme = getActivity().getTheme(); theme.resolveAttribute(R.attr.colorPrimaryDark, headerBackground, true); theme.resolveAttribute(R.attr.navdrawer_background, navdrawerBackground,true); theme.resolveAttribute(R.attr.navdrawer_text_color, navdrawerTextColor, true); recyclerView.setBackgroundResource(navdrawerBackground.resourceId); int childCount = recyclerView.getChildCount(); for (int childIndex = 0; childIndex < childCount; childIndex++) { int viewType = mAdapter.getItemViewType(childIndex); switch (viewType) { case NavigationDrawerAdapter.Type.TYPE_HEADER: ViewGroup header = (ViewGroup) recyclerView.getChildAt(childIndex); header.setBackgroundResource(headerBackground.resourceId); break; case NavigationDrawerAdapter.Type.TYPE_ITEM: ViewGroup item = (ViewGroup) recyclerView.getChildAt(childIndex); TextView textView = (TextView) item.findViewById(R.id.tvItemName); textView.setTextColor(navdrawerTextColor.resourceId); break; case NavigationDrawerAdapter.Type.TYPE_BOTTOM_SPACE: View childView = recyclerView.getChildAt(childIndex); childView.setBackgroundResource(navdrawerBackground.resourceId); break; } } mAdapter.notifyDataSetChanged(); }
@Override public void OnRTMPCHttpOK(String strContent) { mRecyclerViewUtils.endRefreshing(); try { listLive.clear(); JSONObject liveJson = new JSONObject(strContent); Log.d("slj","liveJson:"+strContent); JSONArray liveList = liveJson.getJSONArray("LiveList"); JSONArray memberList = liveJson.getJSONArray("LiveMembers"); if (liveList.length() !=0){ for (int i = 0; i < liveList.length(); i++) { LiveItemBean bean = new LiveItemBean(); JSONObject itemJson = new JSONObject(liveList.getString(i)); bean.setmHosterId(itemJson.getString("hosterId")); bean.setmRtmpPullUrl(itemJson.getString("rtmp_url")); bean.setmHlsUrl(itemJson.getString("hls_url")); bean.setmLiveTopic(itemJson.getString("topic")); bean.setmAnyrtcId(itemJson.getString("anyrtcId")); bean.setmMemNumber(memberList.getInt(i)); listLive.add(bean); } mAdapter.setDatas(listLive); }else{ mRecyclerView.setBackgroundResource(R.drawable.has_no_msg); } } catch (JSONException e) { e.printStackTrace(); } }
@Override protected void callBackRefreshUi() { ThemeColor themeColor = new ThemeColor(this); int resource = themeColor.getResourceId(R.attr.themeBackground); mRecyclerView.setBackgroundResource(resource); StyleUtils.clearRecyclerViewItem(mRecyclerView); StyleUtils.changeSwipeRefreshLayout(mSwipeRefreshLayout); }
root.setBackgroundResource(R.drawable.settings_background); root.setLayoutManager(new LinearLayoutManager(this)); root.setAdapter(new Adapter(this, settings));
root.setBackgroundResource(R.drawable.settings_background); root.setLayoutManager(new LinearLayoutManager(this)); root.setAdapter(new Adapter(this, settings));
root.setBackgroundResource(R.drawable.settings_background); root.setLayoutManager(new LinearLayoutManager(this)); root.setAdapter(new Adapter(this, settings));
root.setBackgroundResource(R.drawable.settings_background); root.setLayoutManager(new LinearLayoutManager(this)); root.setAdapter(new Adapter(this, settings));
root.setBackgroundResource(R.drawable.settings_background); root.setLayoutManager(new LinearLayoutManager(this)); root.setAdapter(new Adapter(this, settings));
mListView.setBackgroundResource(ThemeManager.getInstance().getBackgroundColor()); mAdapter = new ForumListAdapter(this, mDataList); mListView.setAdapter(mAdapter);
root.setBackgroundResource(R.drawable.settings_background); root.setLayoutManager(new LinearLayoutManager(this)); root.setAdapter(new Adapter(this, settings));