本文整理汇总了Java中cn.droidlover.xdroid.demo.net.NetApi类的典型用法代码示例。如果您正苦于以下问题:Java NetApi类的具体用法?Java NetApi怎么用?Java NetApi使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NetApi类属于cn.droidlover.xdroid.demo.net包,在下文中一共展示了NetApi类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCoin
import cn.droidlover.xdroid.demo.net.NetApi; //导入依赖的package包/类
public String getCoin(Callback<String> onCallBack){
if(onCallBack == null){
return mCoin;
}
String signature = getSignature();
HashMap<String, String> params = new HashMap<String, String>();
params.put("request_type","get_coin");
params.put("user_id",mUserId);
params.put("signature", signature);
NetApi.invokeGet(params,onCallBack);
return "";
}
示例2: setUserPassword
import cn.droidlover.xdroid.demo.net.NetApi; //导入依赖的package包/类
public void setUserPassword(String password){
String signature = getSignature();
mPassword = AppKit.stringToMD5(password);
HashMap<String, String> params = new HashMap<String, String>();
params.put("request_type","modify_password");
params.put("user_id",mUserId);
params.put("signature", signature);
params.put("user_password", mPassword);
NetApi.invokeGet(params,null);
PreferenceManager.getDefaultSharedPreferences(App.getContext()).edit().putString("mPassword",user.mPassword).commit();
return;
}
示例3: setEnshrine
import cn.droidlover.xdroid.demo.net.NetApi; //导入依赖的package包/类
public boolean setEnshrine(final String movieId,String isEnshrine){
Map<String,String> mapMovieInfos = new HashMap<String,String>();
mapMovieInfos.put("isEnshrine",isEnshrine);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss");
String t = format.format(new Date());
mapMovieInfos.put("enshrineTime",t);
mDbManager.update(movieId,mapMovieInfos);
HashMap<String, String> params = new HashMap<String, String>();
params.put("request_type","set_enshrine_video");
params.put("movie_id",movieId);
params.put("user_id",User.getInstance().getUserId());
params.put("enshrine",isEnshrine);
NetApi.invokeGet(params,null);
return true;
}
示例4: initChannel
import cn.droidlover.xdroid.demo.net.NetApi; //导入依赖的package包/类
private void initChannel(){
Log.i(App.TAG,"init Channel start");
if(fragmentList.size() == 0){
HashMap<String, String> params = new HashMap<String, String>();
params.put("request_type","fetch_channel");
NetApi.invokeGet(params,callback);
}else {
initPageView();
}
}
示例5: setUserName
import cn.droidlover.xdroid.demo.net.NetApi; //导入依赖的package包/类
public void setUserName(String userName){
mUserName = userName;
String signature = getSignature();
HashMap<String, String> params = new HashMap<String, String>();
params.put("request_type","modify_user_name");
params.put("user_id",mUserId);
params.put("signature", signature);
params.put("user_name", userName);
NetApi.invokeGet(params,null);
return;
}
示例6: setEmail
import cn.droidlover.xdroid.demo.net.NetApi; //导入依赖的package包/类
public void setEmail(String email){
mEmail = email;
String signature = getSignature();
HashMap<String, String> params = new HashMap<String, String>();
params.put("request_type","modify_email");
params.put("user_id",mUserId);
params.put("signature", signature);
params.put("email", email);
NetApi.invokeGet(params,null);
return;
}
示例7: getUnVerifyCoin
import cn.droidlover.xdroid.demo.net.NetApi; //导入依赖的package包/类
public String getUnVerifyCoin(Callback<String> onCallBack){
if(onCallBack == null){
return mUnVerifyCoin;
}
String signature = getSignature();
HashMap<String, String> params = new HashMap<String, String>();
params.put("request_type","get_unverify_coin");
params.put("user_id",mUserId);
params.put("signature", signature);
NetApi.invokeGet(params,onCallBack);
return "";
}
示例8: addVideoPraise
import cn.droidlover.xdroid.demo.net.NetApi; //导入依赖的package包/类
public boolean addVideoPraise(final String movieId){
HashMap<String, String> params = new HashMap<String, String>();
params.put("request_type","add_video_praise");
params.put("movie_id",movieId);
NetApi.invokeGet(params,null);
Map<String,String> mapMovieInfos = new HashMap<String,String>();
mapMovieInfos.put("isPraise","1");
mDbManager.update(movieId,mapMovieInfos);
return true;
}
示例9: loadData
import cn.droidlover.xdroid.demo.net.NetApi; //导入依赖的package包/类
public void loadData(final int page) {
NetApi.getGankService().getGankData(getType(), PAGE_SIZE, page)
.compose(XApi.<GankResults>getObservableScheduler())
.compose(this.<GankResults>bindToLifecycle())
.subscribe(new Observer<GankResults>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull GankResults gankResults) {
if (!gankResults.isError()) {
if (page > 1) {
getAdapter().addData(gankResults.getResults());
} else {
getAdapter().setData(gankResults.getResults());
}
getBinding().contentLayout.getRecyclerView().setPage(page, MAX_PAGE);
if (getAdapter().getItemCount() < 1) {
getBinding().contentLayout.showEmpty();
return;
}
}
}
@Override
public void onError(@NonNull Throwable e) {
getBinding().contentLayout.showError();
}
@Override
public void onComplete() {
}
});
}