本文整理汇总了Java中com.jess.arms.base.App类的典型用法代码示例。如果您正苦于以下问题:Java App类的具体用法?Java App怎么用?Java App使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
App类属于com.jess.arms.base包,在下文中一共展示了App类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: applyOptions
import com.jess.arms.base.App; //导入依赖的package包/类
@Override
public void applyOptions(Context context, GlideBuilder builder) {
builder.setDiskCache(new DiskCache.Factory() {
@Override
public DiskCache build() {
// Careful: the external cache directory doesn't enforce permissions
AppComponent appComponent = ((App) context.getApplicationContext()).getAppComponent();
return DiskLruCacheWrapper.get(DataHelper.makeDirs(new File(appComponent.cacheFile(), "Glide")), IMAGE_DISK_CACHE_MAX_SIZE);
}
});
MemorySizeCalculator calculator = new MemorySizeCalculator(context);
int defaultMemoryCacheSize = calculator.getMemoryCacheSize();
int defaultBitmapPoolSize = calculator.getBitmapPoolSize();
int customMemoryCacheSize = (int) (1.2 * defaultMemoryCacheSize);
int customBitmapPoolSize = (int) (1.2 * defaultBitmapPoolSize);
builder.setMemoryCache(new LruResourceCache(customMemoryCacheSize));
builder.setBitmapPool(new LruBitmapPool(customBitmapPoolSize));
}
开发者ID:yangxp108,项目名称:MVPArms_Fragment-fragment,代码行数:23,代码来源:GlideConfiguration.java
示例2: convert
import com.jess.arms.base.App; //导入依赖的package包/类
@Override
protected void convert(BaseViewHolder helper, ReplySection item) {
ImageView img = helper.getView(R.id.iv_pic);
AppComponent mAppComponent = ((App)img.getContext().getApplicationContext())
.getAppComponent();
if (item.t.getData().getUser()!=null){
mAppComponent.imageLoader().loadImage(img.getContext(),
ImageConfigImpl
.builder()
.transformation(new GlideCircleTransform())
.url(item.t.getData().getUser().getAvatar())
.imageView(img)
.build());
}
DateFormat df = new SimpleDateFormat("yyyy/MM/dd");
if (item.t.getData().getUser()!=null){
helper.setText(R.id.tv_nickname,item.t.getData().getUser().getNickname());
}
helper.setText(R.id.tv_comment,item.t.getData().getMessage())
.setText(R.id.tv_good_num,item.t.getData().getLikeCount()+"")
.setText(R.id.tv_reply_time,df.format(item.t.getData().getCreateTime()));
}
开发者ID:Zweihui,项目名称:Aurora,代码行数:23,代码来源:ReplyAdapter.java
示例3: convert
import com.jess.arms.base.App; //导入依赖的package包/类
@Override
protected void convert(BaseViewHolder helper, MyAttentionEntity item) {
ImageView imgAutor = helper.getView(R.id.img_icon);
Context context = imgAutor.getContext();
AppComponent mAppComponent = ((App)context.getApplicationContext())
.getAppComponent();
mAppComponent.imageLoader().loadImage(context,
ImageConfigImpl
.builder()
.transformation(new GlideCircleTransform())
.url(item.getIcon())
.imageView(imgAutor)
.build());
helper.setText(R.id.tv_name,item.getTitle())
.setText(R.id.tv_desc,item.getDescription());
FollowButton button = helper.getView(R.id.btn_attention);
button.setState(FollowButton.FOLLOWED);
button.setCanClick(false);
}
开发者ID:Zweihui,项目名称:Aurora,代码行数:20,代码来源:AurhorListAdapter.java
示例4: convert
import com.jess.arms.base.App; //导入依赖的package包/类
@Override
protected void convert(BaseViewHolder helper, VideoListInfo.Video item) {
AppComponent mAppComponent = ((App)helper.getView(R.id.iv_bg).getContext().getApplicationContext())
.getAppComponent();
ImageView imgbg = helper.getView(R.id.iv_bg);
Context context = imgbg.getContext();
mAppComponent.imageLoader().loadImage(context,
ImageConfigImpl
.builder()
.url(item.getData().getCover().getFeed())
.imageView(imgbg)
.build());
helper.setText(R.id.tv_name,item.getData().getTitle())
.setText(R.id.tv_desc,getDetailStr(item));
}
开发者ID:Zweihui,项目名称:Aurora,代码行数:16,代码来源:SearchAdapter.java
示例5: convert
import com.jess.arms.base.App; //导入依赖的package包/类
@Override
protected void convert(BaseViewHolder helper, VideoListInfo.Video item) {
AppComponent mAppComponent = ((App)helper.getView(R.id.iv_bg).getContext().getApplicationContext())
.getAppComponent();
ImageView imgBg = helper.getView(R.id.iv_bg);
helper.setText(R.id.tv_title,item.getData().getTitle())
.setText(R.id.tv_detail,getDetailStr(item));
mAppComponent.imageLoader().loadImage(imgBg.getContext(),
ImageConfigImpl
.builder()
.url(item.getData().getCover().getFeed())
.imageView(imgBg)
.build());
}
开发者ID:Zweihui,项目名称:Aurora,代码行数:15,代码来源:AttentionInsideAdapter.java
示例6: convert
import com.jess.arms.base.App; //导入依赖的package包/类
@Override
protected void convert(BaseViewHolder helper, VideoListInfo.Video item) {
helper.setText(R.id.tv_title,item.getData().getTitle())
.setText(R.id.tv_type,getDetailStr(item));
ImageView img = helper.getView(R.id.iv_left);
AppComponent mAppComponent = ((App)img.getContext().getApplicationContext())
.getAppComponent();
Context context = img.getContext();
mAppComponent.imageLoader().loadImage(context,
ImageConfigImpl
.builder()
.url(item.getData().getCover().getFeed())
.imageView(img)
.build());
}
开发者ID:Zweihui,项目名称:Aurora,代码行数:16,代码来源:AuthorVideosAdapter.java
示例7: convert
import com.jess.arms.base.App; //导入依赖的package包/类
@Override
protected void convert(BaseViewHolder helper, VideoListInfo.Video item) {
AppComponent mAppComponent = ((App)helper.getView(R.id.img_main).getContext().getApplicationContext())
.getAppComponent();
ImageView imgMian = helper.getView(R.id.img_main);
ImageView imgAutor = helper.getView(R.id.img_author);
Context context = imgMian.getContext();
Glide.with(context).load(item.getData().getCover().getFeed())
.into(imgMian);
mAppComponent.imageLoader().loadImage(context,
ImageConfigImpl
.builder()
.url(item.getData().getCover().getFeed())
.imageView(imgMian)
.build());
try {
((App)context.getApplicationContext())
.getAppComponent().imageLoader().loadImage(context,
ImageConfigImpl
.builder()
.transformation(new GlideCircleTransform())
.url(StringUtils.replaceNull(item.getData().getAuthor().getIcon()))
.imageView(helper.getView(R.id.img_author))
.build());
}catch (NullPointerException e){
}
helper.setText(R.id.title,item.getData().getTitle())
.setText(R.id.detail,getDetailStr(item));
if (item.getData().getAuthor()!=null){
helper.getView(R.id.img_author).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
gotoAuthorDetail(view,helper.getLayoutPosition());
}
});
}
}
开发者ID:Zweihui,项目名称:Aurora,代码行数:39,代码来源:VideoAdapter.java
示例8: convert
import com.jess.arms.base.App; //导入依赖的package包/类
@Override
protected void convert(BaseViewHolder helper, RelateVideoSection item) {
helper.setText(R.id.tv_title,item.t.getData().getTitle())
.setText(R.id.tv_type,getDetailStr(item.t));
ImageView img = helper.getView(R.id.iv_left);
AppComponent mAppComponent = ((App)img.getContext().getApplicationContext())
.getAppComponent();
Context context = img.getContext();
mAppComponent.imageLoader().loadImage(context,
ImageConfigImpl
.builder()
.url(item.t.getData().getCover().getFeed())
.imageView(img)
.build());
}
开发者ID:Zweihui,项目名称:Aurora,代码行数:16,代码来源:RelateVideoAdapter.java
示例9: onBindViewHolder
import com.jess.arms.base.App; //导入依赖的package包/类
@Override
public void onBindViewHolder(final ViewHolder holder, final int position) {
int fakePosition = position % mList.size();
mCardAdapterHelper.onBindViewHolder(holder.itemView, position, getItemCount());
AppComponent mAppComponent = ((App)holder.mImageView.getContext().getApplicationContext())
.getAppComponent();
Context context = holder.mImageView.getContext();
try {
((App)context.getApplicationContext())
.getAppComponent().imageLoader().loadImage(mAppComponent.appManager().getCurrentActivity() == null
? mAppComponent.application() : mAppComponent.appManager().getCurrentActivity(),
ImageConfigImpl
.builder()
.url(StringUtils.replaceNull(mList.get(fakePosition).getData().getCover().getFeed()))
.imageView(holder.mImageView)
.build());
}catch (NullPointerException e){
}
holder.mLlRoot.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
gotoDetail(view,fakePosition);
}
});
holder.mTvTitle.setText(mList.get(fakePosition).getData().getTitle());
holder.mTvdesc.setText(getDetailStr(mList.get(fakePosition)));
}
开发者ID:Zweihui,项目名称:Aurora,代码行数:29,代码来源:BannerAdapter.java
示例10: convert
import com.jess.arms.base.App; //导入依赖的package包/类
@Override
protected void convert(BaseViewHolder helper, Category item) {
AppComponent mAppComponent = ((App)helper.getView(R.id.iv_bg).getContext().getApplicationContext())
.getAppComponent();
ImageView bg = helper.getView(R.id.iv_bg);
helper.setText(R.id.tv_name,item.getName());
mAppComponent.imageLoader().loadImage(bg.getContext(),
ImageConfigImpl
.builder()
.url(item.getBgPicture())
.imageView(bg)
.build());
}
开发者ID:Zweihui,项目名称:Aurora,代码行数:14,代码来源:CategoryAdapter.java
示例11: applyOptions
import com.jess.arms.base.App; //导入依赖的package包/类
@Override
public void applyOptions(Context context, GlideBuilder builder) {
AppComponent appComponent = ((App) context.getApplicationContext()).getAppComponent();
builder.setDiskCache(new DiskCache.Factory() {
@Override
public DiskCache build() {
// Careful: the external cache directory doesn't enforce permissions
return DiskLruCacheWrapper.get(DataHelper.makeDirs(new File(appComponent.cacheFile(), "Glide")), IMAGE_DISK_CACHE_MAX_SIZE);
}
});
MemorySizeCalculator calculator = new MemorySizeCalculator.Builder(context).build();
int defaultMemoryCacheSize = calculator.getMemoryCacheSize();
int defaultBitmapPoolSize = calculator.getBitmapPoolSize();
int customMemoryCacheSize = (int) (1.2 * defaultMemoryCacheSize);
int customBitmapPoolSize = (int) (1.2 * defaultBitmapPoolSize);
builder.setMemoryCache(new LruResourceCache(customMemoryCacheSize));
builder.setBitmapPool(new LruBitmapPool(customBitmapPoolSize));
//将配置 Glide 的机会转交给 GlideImageLoaderStrategy,如你觉得框架提供的 GlideImageLoaderStrategy
//并不能满足自己的需求,想自定义 BaseImageLoaderStrategy,那请你最好实现 GlideAppliesOptions
//因为只有成为 GlideAppliesOptions 的实现类,这里才能调用 applyGlideOptions(),让你具有配置 Glide 的权利
BaseImageLoaderStrategy loadImgStrategy = appComponent.imageLoader().getLoadImgStrategy();
if (loadImgStrategy instanceof GlideAppliesOptions) {
((GlideAppliesOptions) loadImgStrategy).applyGlideOptions(context, builder);
}
}
开发者ID:devzwy,项目名称:NeiHanDuanZiTV,代码行数:30,代码来源:GlideConfiguration.java
示例12: onCreate
import com.jess.arms.base.App; //导入依赖的package包/类
public void onCreate(Bundle savedInstanceState) {
if (iActivity.useEventBus())//如果要使用eventbus请将此方法返回true
EventBus.getDefault().register(mActivity);//注册到事件主线
iActivity.setupActivityComponent(((App) mActivity.getApplication()).getAppComponent());//依赖注入
try {
int layoutResID = iActivity.initView();
if (layoutResID != 0)//如果initView返回0,框架则不会调用setContentView()
mActivity.setContentView(layoutResID);
} catch (Exception e) {
e.printStackTrace();
}
//绑定到butterknife
mUnbinder = ButterKnife.bind(mActivity);
iActivity.initData();
}
开发者ID:hshare,项目名称:MVPArmsTest1,代码行数:16,代码来源:ActivityDelegateImpl.java
示例13: injectFragmentLifecycle
import com.jess.arms.base.App; //导入依赖的package包/类
@Override
public void injectFragmentLifecycle(Context context, List<FragmentManager.FragmentLifecycleCallbacks> lifecycles) {
lifecycles.add(new FragmentManager.FragmentLifecycleCallbacks() {
@Override
public void onFragmentDestroyed(FragmentManager fm, Fragment f) {
((RefWatcher) ((App) f.getActivity().getApplication()).getAppComponent().extras().get(RefWatcher.class.getName())).watch(this);
}
});
}
开发者ID:hshare,项目名称:MVPArmsTest1,代码行数:10,代码来源:GlobalConfiguration.java
示例14: onCreate
import com.jess.arms.base.App; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
if (iFragment.useEventBus())//如果要使用eventbus请将此方法返回true
EventBus.getDefault().register(mFragment);//注册到事件主线
iFragment.setupFragmentComponent(((App) mFragment.getActivity().getApplication()).getAppComponent());
}
开发者ID:yangxp108,项目名称:MVPArms_Fragment-fragment,代码行数:7,代码来源:FragmentDelegateImpl.java
示例15: onCreate
import com.jess.arms.base.App; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
if (iActivity.useEventBus())//如果要使用eventbus请将此方法返回true
EventBus.getDefault().register(mActivity);//注册到事件主线
iActivity.setupActivityComponent(((App) mActivity.getApplication()).getAppComponent());//依赖注入
}
开发者ID:yangxp108,项目名称:MVPArms_Fragment-fragment,代码行数:7,代码来源:ActivityDelegateImpl.java
示例16: registerComponents
import com.jess.arms.base.App; //导入依赖的package包/类
@Override
public void registerComponents(Context context, Glide glide) {
//Glide默认使用HttpURLConnection做网络请求,在这切换成okhttp请求
AppComponent appComponent = ((App) context.getApplicationContext()).getAppComponent();
glide.register(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(appComponent.okHttpClient()));
}
开发者ID:yangxp108,项目名称:MVPArms_Fragment-fragment,代码行数:7,代码来源:GlideConfiguration.java
示例17: obtainAppComponentFromContext
import com.jess.arms.base.App; //导入依赖的package包/类
public static AppComponent obtainAppComponentFromContext(Context context) {
Preconditions.checkState(context.getApplicationContext() instanceof App, "Application does not implements App");
return ((App) context.getApplicationContext()).getAppComponent();
}
开发者ID:Superingxz,项目名称:MoligyMvpArms,代码行数:5,代码来源:ArmsUtils.java
示例18: obtainAppComponentFromContext
import com.jess.arms.base.App; //导入依赖的package包/类
public static AppComponent obtainAppComponentFromContext(Context context) {
Preconditions.checkNotNull(context, "%s cannot be null", Context.class.getName());
Preconditions.checkState(context.getApplicationContext() instanceof App, "Application does not implements App");
return ((App) context.getApplicationContext()).getAppComponent();
}
开发者ID:Zweihui,项目名称:Aurora,代码行数:6,代码来源:ArmsUtils.java
示例19: convert
import com.jess.arms.base.App; //导入依赖的package包/类
@Override
protected void convert(BaseViewHolder helper, VideoDownLoadInfo item) {
AppComponent mAppComponent = ((App)helper.getView(R.id.iv_bg).getContext().getApplicationContext())
.getAppComponent();
ImageView imgMian = helper.getView(R.id.iv_bg);
Context context = imgMian.getContext();
helper.setText(R.id.tv_title,item.getVideo().getTitle());
if (item.getVideo().getAuthor()!=null){
helper.setText(R.id.tv_author,item.getVideo().getAuthor().getName());
}
helper.setText(R.id.tv_size, StringUtils.getPrintSize(item.getContentLength() == null ?0:item.getContentLength(),true));
helper.addOnClickListener(R.id.iv_more);
helper.addOnClickListener(R.id.ll_detail);
helper.addOnClickListener(R.id.ll_progress);
helper.addOnClickListener(R.id.ctl_layout);
if (!type.contains("正在")){
helper.getView(R.id.ll_detail).setVisibility(View.VISIBLE);
}else {
helper.getView(R.id.ll_detail).setVisibility(View.GONE);
}
if (item.getFinish()){
helper.getView(R.id.ll_progress).setVisibility(View.GONE);
helper.getView(R.id.tv_size).setVisibility(View.VISIBLE);
}else {
helper.getView(R.id.tv_size).setVisibility(View.GONE);
// if (downPosition == helper.getLayoutPosition()){
// helper.getView(R.id.ll_progress).setVisibility(View.VISIBLE);
// helper.getView(R.id.sb_progress).setVisibility(View.VISIBLE);
// ((SeekBar)helper.getView(R.id.sb_progress)).setProgress(item.getPercent());
// String size = StringUtils.getPrintSize(item.getCurrentBytes() == null ?0:item.getContentLength(),false) + "/" + StringUtils.getPrintSize(item.getContentLength() == null ?0:item.getContentLength(),true);
// helper.setText(R.id.tv_pause,size);
// }else {
if (item.isPending()){
helper.setText(R.id.tv_pause,"正在连接中...");
((ProgressBar)helper.getView(R.id.sb_progress)).setIndeterminate(true);
helper.getView(R.id.ll_progress).setVisibility(View.VISIBLE);
helper.getView(R.id.sb_progress).setVisibility(View.VISIBLE);
}else {
if (item.isLineUp()){
helper.setText(R.id.tv_pause,"排队中");
}else {
helper.setText(R.id.tv_pause,"已暂停");
}
helper.getView(R.id.ll_progress).setVisibility(View.VISIBLE);
helper.getView(R.id.sb_progress).setVisibility(View.GONE);
}
// }
}
mAppComponent.imageLoader().loadImage(context,
ImageConfigImpl
.builder()
.url(item.getVideo().getCover().getFeed())
.imageView(imgMian)
.build());
}
开发者ID:Zweihui,项目名称:Aurora,代码行数:57,代码来源:CacheAdapter.java
示例20: convert
import com.jess.arms.base.App; //导入依赖的package包/类
@Override
protected void convert(BaseViewHolder helper, AuthorDynamicInfo.Dynamic item) {
Context context = helper.itemView.getContext();
AppComponent mAppComponent = ((App)context.getApplicationContext())
.getAppComponent();
helper.setText(R.id.tv_author,item.getData().getUser().getNickname());
helper.setText(R.id.tv_operation,item.getData().getText());
helper.setText(R.id.tv_date, DateUtils.DateToString(new Date(item.getData().getCreateDate()),DateUtils.DATE_TO_STRING_SHORT_PATTERN));
ImageView face = helper.getView(R.id.iv_face);
mAppComponent.imageLoader().loadImage(context,
ImageConfigImpl
.builder()
.url(item.getData().getUser().getAvatar())
.imageView(face)
.build());
if ("video".equals(item.getData().getDynamicType())){
helper.setText(R.id.tv_video_name,item.getData().getSimpleVideo().getTitle());
helper.setText(R.id.tv_video_detail,getDetailStr(item.getData().getSimpleVideo().getDuration()+"",item.getData().getSimpleVideo().getCategory()));
helper.getView(R.id.ctl_video).setVisibility(View.VISIBLE);
helper.getView(R.id.ctl_follow).setVisibility(View.GONE);
ImageView iv6 = helper.getView(R.id.imageView6);
mAppComponent.imageLoader().loadImage(context,
ImageConfigImpl
.builder()
.url(item.getData().getSimpleVideo().getCover().getFeed())
.imageView(iv6)
.build());
}
if ("follow".equals(item.getData().getDynamicType())){
helper.setText(R.id.tv_follow_name,item.getData().getBriefCard().getTitle());
helper.setText(R.id.tv_follow_detail,item.getData().getBriefCard().getDescription());
helper.getView(R.id.ctl_video).setVisibility(View.GONE);
helper.getView(R.id.ctl_follow).setVisibility(View.VISIBLE);
ImageView iv7 = helper.getView(R.id.imageView7);
mAppComponent.imageLoader().loadImage(context,
ImageConfigImpl
.builder()
.transformation(new GlideCircleTransform())
.url(item.getData().getBriefCard().getIcon())
.imageView(iv7)
.build());
}
}
开发者ID:Zweihui,项目名称:Aurora,代码行数:44,代码来源:AuthorDynamicAdapter.java
注:本文中的com.jess.arms.base.App类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论