本文整理匯總了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();
}
}
示例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";
}
}
示例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();
}
示例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);
}
});
}
示例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();
}
示例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();
}
示例7: getResoure
import com.example.jingbin.cloudreader.app.CloudReaderApplication; //導入依賴的package包/類
public static Resources getResoure() {
return CloudReaderApplication.getInstance().getResources();
}
示例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);
}
示例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);
}
示例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());
}
示例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());
}
示例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);
}