本文整理汇总了Java中com.example.retrofit.R类的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
R类属于com.example.retrofit包,在下文中一共展示了R类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onClick
import com.example.retrofit.R; //导入依赖的package包/类
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_rx_all:
Intent intentC = new Intent(this, CombinApiActivity.class);
startActivity(intentC);
break;
case R.id.btn_rx:
manager.doHttpDeal(postEntity);
break;
case R.id.btn_rx_uploade:
manager.doHttpDeal(uplaodApi);
break;
case R.id.btn_rx_mu_down:
Intent intent = new Intent(this, DownLaodActivity.class);
startActivity(intent);
break;
}
}
开发者ID:wzgiceman,项目名称:RxjavaRetrofitDemo-string-master,代码行数:20,代码来源:MainActivity.java
示例2: onClick
import com.example.retrofit.R; //导入依赖的package包/类
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_simple:
onButton9Click();
break;
case R.id.btn_rx:
simpleDo();
break;
case R.id.btn_rx_uploade:
uploadeDo();
break;
case R.id.btn_rx_mu_down:
Intent intent=new Intent(this,DownLaodActivity.class);
startActivity(intent);
break;
}
}
开发者ID:wzgiceman,项目名称:RxjavaRetrofitDemo-master,代码行数:19,代码来源:MainActivity.java
示例3: onCreate
import com.example.retrofit.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tvMsg = (TextView) findViewById(R.id.tv_msg);
findViewById(R.id.btn_rx).setOnClickListener(this);
findViewById(R.id.btn_rx_mu_down).setOnClickListener(this);
findViewById(R.id.btn_rx_uploade).setOnClickListener(this);
img = (ImageView) findViewById(R.id.img);
progressBar = (NumberProgressBar) findViewById(R.id.number_progress_bar);
/*初始化数据*/
manager = new HttpManager(this, this);
postEntity = new SubjectPostApi();
postEntity.setAll(true);
/*上传接口内部接口有token验证,所以需要换成自己的接口测试,检查file文件是否手机存在*/
uplaodApi = new UploadApi();
File file = new File("/storage/emulated/0/Download/11.jpg");
RequestBody requestBody = RequestBody.create(MediaType.parse("image/jpeg"), file);
MultipartBody.Part part = MultipartBody.Part.createFormData("file_name", file.getName(), new ProgressRequestBody
(requestBody,
new UploadProgressListener() {
@Override
public void onProgress(long currentBytesCount, long totalBytesCount) {
tvMsg.setText("提示:上传中");
progressBar.setMax((int) totalBytesCount);
progressBar.setProgress((int) currentBytesCount);
}
}));
uplaodApi.setPart(part);
}
开发者ID:wzgiceman,项目名称:RxRetrofit-tokean,代码行数:35,代码来源:MainActivity.java
示例4: onClick
import com.example.retrofit.R; //导入依赖的package包/类
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_rx:
manager.doHttpDeal(postEntity);
break;
case R.id.btn_rx_uploade:
manager.doHttpDeal(uplaodApi);
break;
case R.id.btn_rx_mu_down:
Intent intent = new Intent(this, DownLaodActivity.class);
startActivity(intent);
break;
}
}
开发者ID:wzgiceman,项目名称:RxRetrofit-tokean,代码行数:16,代码来源:MainActivity.java
示例5: DownHolder
import com.example.retrofit.R; //导入依赖的package包/类
public DownHolder(ViewGroup parent) {
super(parent, R.layout.view_item_holder);
manager= HttpDownManager.getInstance();
$(R.id.btn_rx_down).setOnClickListener(this);
$(R.id.btn_rx_pause).setOnClickListener(this);
progressBar=$(R.id.number_progress_bar);
tvMsg=$(R.id.tv_msg);
}
开发者ID:wzgiceman,项目名称:RxRetrofit-tokean,代码行数:9,代码来源:DownHolder.java
示例6: onClick
import com.example.retrofit.R; //导入依赖的package包/类
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_rx_down:
if(apkApi.getState()!= DownState.FINISH){
manager.startDown(apkApi);
}
break;
case R.id.btn_rx_pause:
manager.pause(apkApi);
break;
}
}
开发者ID:wzgiceman,项目名称:RxRetrofit-tokean,代码行数:14,代码来源:DownHolder.java
示例7: onCreate
import com.example.retrofit.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_down_laod);
initResource();
initWidget();
}
开发者ID:wzgiceman,项目名称:RxRetrofit-tokean,代码行数:8,代码来源:DownLaodActivity.java
示例8: initWidget
import com.example.retrofit.R; //导入依赖的package包/类
private void initWidget(){
EasyRecyclerView recyclerView=(EasyRecyclerView)findViewById(R.id.rv);
DownAdapter adapter=new DownAdapter(this);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(adapter);
adapter.addAll(listData);
}
开发者ID:wzgiceman,项目名称:RxRetrofit-tokean,代码行数:8,代码来源:DownLaodActivity.java
示例9: initWidget
import com.example.retrofit.R; //导入依赖的package包/类
private void initWidget() {
EasyRecyclerView recyclerView = (EasyRecyclerView) findViewById(R.id.rv);
DownAdapter adapter = new DownAdapter(this);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(adapter);
adapter.addAll(listData);
}
开发者ID:wzgiceman,项目名称:RxjavaRetrofitDemo-string-master,代码行数:8,代码来源:DownLaodActivity.java
示例10: onCreate
import com.example.retrofit.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tvMsg = (TextView) findViewById(R.id.tv_msg);
findViewById(R.id.btn_simple).setOnClickListener(this);
findViewById(R.id.btn_rx).setOnClickListener(this);
findViewById(R.id.btn_rx_mu_down).setOnClickListener(this);
findViewById(R.id.btn_rx_uploade).setOnClickListener(this);
img=(ImageView)findViewById(R.id.img);
progressBar=(NumberProgressBar)findViewById(R.id.number_progress_bar);
}
开发者ID:wzgiceman,项目名称:RxjavaRetrofitDemo-master,代码行数:13,代码来源:MainActivity.java
示例11: onCreate
import com.example.retrofit.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_mvp);
ButterKnife.bind(this);
plistener = new P(this);
}
开发者ID:wzgiceman,项目名称:RxRetrofit-mvp,代码行数:8,代码来源:MvpActivity.java
示例12: onCreate
import com.example.retrofit.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tvMsg = (TextView) findViewById(R.id.tv_msg);
findViewById(R.id.btn_rx).setOnClickListener(this);
findViewById(R.id.btn_rx_all).setOnClickListener(this);
findViewById(R.id.btn_rx_mu_down).setOnClickListener(this);
findViewById(R.id.btn_rx_uploade).setOnClickListener(this);
img = (ImageView) findViewById(R.id.img);
progressBar = (NumberProgressBar) findViewById(R.id.number_progress_bar);
/*初始化数据*/
manager = new HttpManager(this, this);
postEntity = new SubjectPostApi();
postEntity.setAll(true);
/*上传接口内部接口有token验证,所以需要换成自己的接口测试,检查file文件是否手机存在*/
uplaodApi = new UploadApi();
File file = new File("/storage/emulated/0/Download/11.jpg");
RequestBody requestBody = RequestBody.create(MediaType.parse("image/jpeg"), file);
MultipartBody.Part part = MultipartBody.Part.createFormData("file_name", file.getName(), new ProgressRequestBody
(requestBody, new UploadProgressListener() {
@Override
public void onProgress(final long currentBytesCount, final long totalBytesCount) {
/*回到主线程中,可通过timer等延迟或者循环避免快速刷新数据*/
Observable.just(currentBytesCount).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<Long>() {
@Override
public void call(Long aLong) {
tvMsg.setText("提示:上传中");
progressBar.setMax((int) totalBytesCount);
progressBar.setProgress((int) currentBytesCount);
}
});
}
}));
uplaodApi.setPart(part);
}
开发者ID:wzgiceman,项目名称:RxjavaRetrofitDemo-string-master,代码行数:43,代码来源:MainActivity.java
示例13: onTvTestClick
import com.example.retrofit.R; //导入依赖的package包/类
@OnClick(value = R.id.tv_test)
void onTvTestClick(View view) {
plistener.doTest("1");
}
开发者ID:wzgiceman,项目名称:RxRetrofit-mvp,代码行数:5,代码来源:MvpActivity.java
示例14: onTvMsgClick
import com.example.retrofit.R; //导入依赖的package包/类
@OnClick(value = R.id.tv_msg)
void onTvMsgClick(View view) {
SubjectPostApi postEntity = new SubjectPostApi();
postEntity.setAll(true);
plistener.startPost(MvpActivity.this, postEntity);
}
开发者ID:wzgiceman,项目名称:RxRetrofit-mvp,代码行数:7,代码来源:MvpActivity.java
注:本文中的com.example.retrofit.R类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论