本文整理匯總了Java中com.example.jingbin.cloudreader.R類的典型用法代碼示例。如果您正苦於以下問題:Java R類的具體用法?Java R怎麽用?Java R使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
R類屬於com.example.jingbin.cloudreader包,在下文中一共展示了R類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setToolBar
import com.example.jingbin.cloudreader.R; //導入依賴的package包/類
/**
* 設置titlebar
*/
protected void setToolBar() {
setSupportActionBar(mBaseBinding.toolBar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
//去除默認Title顯示
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeAsUpIndicator(R.drawable.icon_back);
}
mBaseBinding.toolBar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
}
示例2: onActivityCreated
import com.example.jingbin.cloudreader.R; //導入依賴的package包/類
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mLlProgressBar = getView(R.id.ll_progress_bar);
ImageView img = getView(R.id.img_progress);
// 加載動畫
mAnimationDrawable = (AnimationDrawable) img.getDrawable();
// 默認進入頁麵就開啟動畫
if (!mAnimationDrawable.isRunning()) {
mAnimationDrawable.start();
}
mRefresh = getView(R.id.ll_error_refresh);
// 點擊加載失敗布局
mRefresh.setOnClickListener(new PerfectClickListener() {
@Override
protected void onNoDoubleClick(View v) {
showLoading();
onRefresh();
}
});
bindingView.getRoot().setVisibility(View.GONE);
}
示例3: LoadBannerData
import com.example.jingbin.cloudreader.R; //導入依賴的package包/類
/**
* 加載廣告
*/
public void LoadBannerData()
{
bannercontainer= (LinearLayout) findViewById(R.id.bannercontainer);
SpotManager.getInstance(this).requestData(this, new DataRequestListener() {
@Override
public void onRequestSuccess() {
AddBanner();
}
@Override
public void onRequestFailed(int i) {
AddBanner();
}
});
}
示例4: onCreate
import com.example.jingbin.cloudreader.R; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_douban_top);
setTitle("豆瓣電影Top250");
mDouBanTopAdapter = new DouBanTopAdapter(DoubanTopActivity.this);
loadDouBanTop250();
bindingView.xrvTop.setLoadingListener(new XRecyclerView.LoadingListener() {
@Override
public void onRefresh() {
}
@Override
public void onLoadMore() {
mStart += mCount;
loadDouBanTop250();
}
});
}
示例5: initRecyclerView
import com.example.jingbin.cloudreader.R; //導入依賴的package包/類
private void initRecyclerView() {
bindingView.xrvEveryday.setPullRefreshEnabled(false);
bindingView.xrvEveryday.setLoadingMoreEnabled(false);
if (mHeaderView == null) {
mHeaderView = mHeaderBinding.getRoot();
bindingView.xrvEveryday.addHeaderView(mHeaderView);
}
if (mFooterView == null) {
mFooterBinding = DataBindingUtil.inflate(LayoutInflater.from(getContext()), R.layout.footer_item_everyday, null, false);
mFooterView = mFooterBinding.getRoot();
bindingView.xrvEveryday.addFootView(mFooterView, true);
bindingView.xrvEveryday.noMoreLoading();
}
bindingView.xrvEveryday.setLayoutManager(new LinearLayoutManager(getContext()));
// 需加,不然滑動不流暢
bindingView.xrvEveryday.setNestedScrollingEnabled(false);
bindingView.xrvEveryday.setHasFixedSize(false);
bindingView.xrvEveryday.setItemAnimator(new DefaultItemAnimator());
}
示例6: onCreate
import com.example.jingbin.cloudreader.R; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_nav_about);
showContentView();
setTitle("關於雲閱");
bindingView.tvVersionName.setText("當前版本 V" + BaseTools.getVersionName());
// 直接寫在布局文件裏會很耗內存
Glide.with(this).load(R.drawable.ic_cloudreader).into(bindingView.ivIcon);
bindingView.tvGankio.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG); //下劃線
bindingView.tvGankio.getPaint().setAntiAlias(true);//抗鋸齒
bindingView.tvDouban.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG); //下劃線
bindingView.tvDouban.getPaint().setAntiAlias(true);//抗鋸齒
initListener();
}
示例7: onNoDoubleClick
import com.example.jingbin.cloudreader.R; //導入依賴的package包/類
@Override
protected void onNoDoubleClick(View v) {
String url = null;
switch (v.getId()) {
case R.id.tv_gankio:
url = CommonUtils.getString(R.string.string_url_gankio);
break;
case R.id.tv_douban:
url = CommonUtils.getString(R.string.string_url_douban);
break;
case R.id.tv_about_star:
url = CommonUtils.getString(R.string.string_url_cloudreader);
break;
case R.id.tv_function:// 更新日誌
url = string_url_update_log;
break;
}
WebViewActivity.loadUrl(v.getContext(), url, "加載中...");
}
示例8: onCreate
import com.example.jingbin.cloudreader.R; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_one_movie_detail);
if (getIntent() != null) {
subjectsBean = (SubjectsBean) getIntent().getSerializableExtra("bean");
}
initSlideShapeTheme(setHeaderImgUrl(), setHeaderImageView());
setTitle(subjectsBean.getTitle());
setSubTitle(String.format("主演:%s", StringFormatUtil.formatName(subjectsBean.getCasts())));
// ImgLoadUtil.showImg(bindingHeaderView.ivOnePhoto,subjectsBean.getImages().getLarge());
bindingHeaderView.setSubjectsBean(subjectsBean);
bindingHeaderView.executePendingBindings();
loadMovieDetail();
}
示例9: onBindViewHolder
import com.example.jingbin.cloudreader.R; //導入依賴的package包/類
@Override
public void onBindViewHolder(final List<AndroidBean> object, int position) {
if ("福利".equals(object.get(0).getType())) {
binding.tvOnePhotoTitle.setVisibility(View.GONE);
binding.ivOnePhoto.setScaleType(ImageView.ScaleType.CENTER_CROP);
// ImgLoadUtil.displayEspImage(object.get(0).getUrl(), binding.ivOnePhoto, 1);
Glide.with(binding.ivOnePhoto.getContext())
.load(object.get(0).getUrl())
.crossFade(1500)
.placeholder(R.drawable.img_two_bi_one)
.error(R.drawable.img_two_bi_one)
.into(binding.ivOnePhoto);
} else {
binding.tvOnePhotoTitle.setVisibility(View.VISIBLE);
setDes(object, 0, binding.tvOnePhotoTitle);
displayRandomImg(1, 0, binding.ivOnePhoto, object);
}
setOnClick(binding.llOnePhoto, object.get(0));
}
示例10: setTitleBar
import com.example.jingbin.cloudreader.R; //導入依賴的package包/類
private void setTitleBar() {
setSupportActionBar(binding.titleToolBar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
//去除默認Title顯示
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeAsUpIndicator(R.drawable.icon_back);
}
// title
binding.tvTitle.setText(subjectsBean.getTitle());
// 副標題
binding.tvSubtitle.setText("主演:" + StringFormatUtil.formatName(subjectsBean.getCasts()));
binding.titleToolBar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
}
示例11: setContentView
import com.example.jingbin.cloudreader.R; //導入依賴的package包/類
@Override
public void setContentView(@LayoutRes int layoutResID) {
mBaseBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.activity_base, null, false);
bindingView = DataBindingUtil.inflate(getLayoutInflater(), layoutResID, null, false);
// content
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
bindingView.getRoot().setLayoutParams(params);
RelativeLayout mContainer = (RelativeLayout) mBaseBinding.getRoot().findViewById(R.id.container);
mContainer.addView(bindingView.getRoot());
getWindow().setContentView(mBaseBinding.getRoot());
// 設置透明狀態欄
StatusBarUtil.setColor(this, CommonUtils.getColor(R.color.colorTheme),0);
llProgressBar = getView(R.id.ll_progress_bar);
refresh = getView(R.id.ll_error_refresh);
ImageView img = getView(R.id.img_progress);
// 加載動畫
mAnimationDrawable = (AnimationDrawable) img.getDrawable();
// 默認進入頁麵就開啟動畫
if (!mAnimationDrawable.isRunning()) {
mAnimationDrawable.start();
}
setToolBar();
// 點擊加載失敗布局
refresh.setOnClickListener(new PerfectClickListener() {
@Override
protected void onNoDoubleClick(View v) {
showLoading();
onRefresh();
}
});
bindingView.getRoot().setVisibility(View.GONE);
}
示例12: onCreate
import com.example.jingbin.cloudreader.R; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_big_image);
getView();
}
示例13: setToolBar
import com.example.jingbin.cloudreader.R; //導入依賴的package包/類
/**
* 設置toolbar
*/
protected void setToolBar() {
setSupportActionBar(bindingTitleView.tbBaseTitle);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
//去除默認Title顯示
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeAsUpIndicator(R.drawable.icon_back);
}
// 手動設置才有效果
bindingTitleView.tbBaseTitle.setTitleTextAppearance(this, R.style.ToolBar_Title);
bindingTitleView.tbBaseTitle.setSubtitleTextAppearance(this, R.style.Toolbar_SubTitle);
bindingTitleView.tbBaseTitle.inflateMenu(R.menu.base_header_menu);
bindingTitleView.tbBaseTitle.setOverflowIcon(ContextCompat.getDrawable(this, R.drawable.actionbar_more));
bindingTitleView.tbBaseTitle.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
bindingTitleView.tbBaseTitle.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.actionbar_more:// 更多信息
setTitleClickMore();
break;
}
return false;
}
});
}
示例14: initScrollViewListener
import com.example.jingbin.cloudreader.R; //導入依賴的package包/類
private void initScrollViewListener() {
// 為了兼容23以下
((MyNestedScrollView) findViewById(R.id.mns_base)).setOnScrollChangeListener(new MyNestedScrollView.ScrollInterface() {
@Override
public void onScrollChange(int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
scrollChangeHeader(scrollY);
}
});
}
示例15: onCreateView
import com.example.jingbin.cloudreader.R; //導入依賴的package包/類
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View ll = inflater.inflate(R.layout.fragment_base, null);
bindingView = DataBindingUtil.inflate(getActivity().getLayoutInflater(), setContent(), null, false);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
bindingView.getRoot().setLayoutParams(params);
mContainer = (RelativeLayout) ll.findViewById(R.id.container);
mContainer.addView(bindingView.getRoot());
return ll;
}