当前位置: 首页>>代码示例>>Java>>正文


Java CloudReaderApplication类代码示例

本文整理汇总了Java中com.example.jingbin.cloudreader.app.CloudReaderApplication的典型用法代码示例。如果您正苦于以下问题:Java CloudReaderApplication类的具体用法?Java CloudReaderApplication怎么用?Java CloudReaderApplication使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CloudReaderApplication类属于com.example.jingbin.cloudreader.app包,在下文中一共展示了CloudReaderApplication类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleCache

import com.example.jingbin.cloudreader.app.CloudReaderApplication; //导入依赖的package包/类
public void handleCache() {
    ArrayList<FrontpageBean.ResultBeanXXXXXXXXXXXXXX.FocusBean.ResultBeanX> result = null;
    try {
        mBannerImages = (ArrayList<String>) ACache.get(CloudReaderApplication.getInstance()).getAsObject(Constants.BANNER_PIC);
        result = (ArrayList<FrontpageBean.ResultBeanXXXXXXXXXXXXXX.FocusBean.ResultBeanX>) ACache.get(CloudReaderApplication.getInstance()).getAsObject(Constants.BANNER_PIC_DATA);
    } catch (Exception ignored) {
    }
    if (mBannerImages != null && mBannerImages.size() > 0) {
        // 加上缓存使其可以点击
        everydayNavigator.showBannerView(mBannerImages, result);
    } else {
        showBanncerPage();
    }
    mLists = (ArrayList<List<AndroidBean>>) ACache.get(CloudReaderApplication.getInstance()).getAsObject(Constants.EVERYDAY_CONTENT);
    if (mLists != null && mLists.size() > 0) {
        everydayNavigator.showListView(mLists);
    } else {
        everydayNavigator.showRotaLoading();
        showRecyclerViewData();
    }
}
 
开发者ID:youlookwhat,项目名称:CloudReader,代码行数:22,代码来源:EverydayViewModel.java

示例2: getVersionName

import com.example.jingbin.cloudreader.app.CloudReaderApplication; //导入依赖的package包/类
/**
 * 获取当前应用的版本号
 */
public static String getVersionName() {
    // 获取packagemanager的实例
    PackageManager packageManager = CloudReaderApplication.getInstance().getPackageManager();
    // getPackageName()是你当前类的包名,0代表是获取版本信息
    PackageInfo packInfo = null;
    try {
        packInfo = packageManager.getPackageInfo(CloudReaderApplication.getInstance().getPackageName(), 0);
        return packInfo.versionName;
    } catch (PackageManager.NameNotFoundException e) {
        e.printStackTrace();
        return "1.0";
    }
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:17,代码来源:BaseTools.java

示例3: showToast

import com.example.jingbin.cloudreader.app.CloudReaderApplication; //导入依赖的package包/类
public static void showToast(String text) {
    if (mToast == null) {
        mToast = Toast.makeText(CloudReaderApplication.getInstance(), text, Toast.LENGTH_SHORT);
    }
    mToast.setText(text);
    mToast.show();
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:8,代码来源:ToastUtil.java

示例4: showBanncerPage

import com.example.jingbin.cloudreader.app.CloudReaderApplication; //导入依赖的package包/类
private void showBanncerPage() {
    mEverydayModel.showBanncerPage(new RequestImpl() {
        @Override
        public void loadSuccess(Object object) {
            if (mBannerImages == null) {
                mBannerImages = new ArrayList<String>();
            } else {
                mBannerImages.clear();
            }
            FrontpageBean bean = (FrontpageBean) object;
            if (bean != null && bean.getResult() != null && bean.getResult().getFocus() != null && bean.getResult().getFocus().getResult() != null) {
                final ArrayList<FrontpageBean.ResultBeanXXXXXXXXXXXXXX.FocusBean.ResultBeanX> result = (ArrayList<FrontpageBean.ResultBeanXXXXXXXXXXXXXX.FocusBean.ResultBeanX>) bean.getResult().getFocus().getResult();
                if (result != null && result.size() > 0) {
                    for (int i = 0; i < result.size(); i++) {
                        //获取所有图片
                        mBannerImages.add(result.get(i).getRandpic());
                    }
                    everydayNavigator.showBannerView(mBannerImages, result);
                    ACache.get(CloudReaderApplication.getInstance()).remove(Constants.BANNER_PIC);
                    ACache.get(CloudReaderApplication.getInstance()).put(Constants.BANNER_PIC, mBannerImages);
                    ACache.get(CloudReaderApplication.getInstance()).remove(Constants.BANNER_PIC_DATA);
                    ACache.get(CloudReaderApplication.getInstance()).put(Constants.BANNER_PIC_DATA, result);
                }
            }
        }

        @Override
        public void loadFailed() {

        }

        @Override
        public void addSubscription(Subscription subscription) {
            activity.addSubscription(subscription);
        }
    });
}
 
开发者ID:youlookwhat,项目名称:CloudReader,代码行数:38,代码来源:EverydayViewModel.java

示例5: BigAndroidViewModel

import com.example.jingbin.cloudreader.app.CloudReaderApplication; //导入依赖的package包/类
public BigAndroidViewModel(BaseFragment activity, String mType) {
    this.activity = activity;
    this.mType = mType;

    mACache = ACache.get(CloudReaderApplication.getInstance());
    mModel = new GankOtherModel();
}
 
开发者ID:youlookwhat,项目名称:CloudReader,代码行数:8,代码来源:BigAndroidViewModel.java

示例6: showToast

import com.example.jingbin.cloudreader.app.CloudReaderApplication; //导入依赖的package包/类
@SuppressLint("ShowToast")
public static void showToast(String text) {
    if (mToast == null) {
        mToast = Toast.makeText(CloudReaderApplication.getInstance(), text, Toast.LENGTH_SHORT);
    }
    mToast.setText(text);
    mToast.show();
}
 
开发者ID:youlookwhat,项目名称:CloudReader,代码行数:9,代码来源:ToastUtil.java

示例7: getResoure

import com.example.jingbin.cloudreader.app.CloudReaderApplication; //导入依赖的package包/类
public static Resources getResoure() {
    return CloudReaderApplication.getInstance().getResources();
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:4,代码来源:CommonUtils.java

示例8: dip2px

import com.example.jingbin.cloudreader.app.CloudReaderApplication; //导入依赖的package包/类
/**
 * 根据手机的分辨率从 dp 的单位 转成为 px(像素)
 */
public static int dip2px(float dpValue) {
    final float scale = CloudReaderApplication.getInstance().getResources().getDisplayMetrics().density;
    return (int) (dpValue * scale + 0.5f);
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:8,代码来源:DensityUtil.java

示例9: px2dip

import com.example.jingbin.cloudreader.app.CloudReaderApplication; //导入依赖的package包/类
/**
 * 根据手机的分辨率从 px(像素) 的单位 转成为 dp
 */
public static int px2dip(float pxValue) {
    final float scale = CloudReaderApplication.getInstance().getResources().getDisplayMetrics().density;
    return (int) (pxValue / scale + 0.5f);
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:8,代码来源:DensityUtil.java

示例10: copy

import com.example.jingbin.cloudreader.app.CloudReaderApplication; //导入依赖的package包/类
/**
 * 实现文本复制功能
 *
 * @param content 复制的文本
 */
public static void copy(String content) {
    // 得到剪贴板管理器
    ClipboardManager cmb = (ClipboardManager) CloudReaderApplication.getInstance().getSystemService(Context.CLIPBOARD_SERVICE);
    cmb.setText(content.trim());
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:11,代码来源:BaseTools.java

示例11: WelfareViewModel

import com.example.jingbin.cloudreader.app.CloudReaderApplication; //导入依赖的package包/类
public WelfareViewModel(BaseFragment activity) {
    this.activity = activity;
    mModel = new GankOtherModel();
    mACache = ACache.get(CloudReaderApplication.getInstance());
}
 
开发者ID:youlookwhat,项目名称:CloudReader,代码行数:6,代码来源:WelfareViewModel.java

示例12: getSharedPreference

import com.example.jingbin.cloudreader.app.CloudReaderApplication; //导入依赖的package包/类
/**
 * 获取SharedPreferences实例对象
 *
 * @param fileName
 */
private static SharedPreferences getSharedPreference(String fileName) {
    return CloudReaderApplication.getInstance().getSharedPreferences(fileName, Context.MODE_PRIVATE);
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:9,代码来源:SPUtils.java


注:本文中的com.example.jingbin.cloudreader.app.CloudReaderApplication类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。