use of com.shizhefei.test.models.datasource.BookDetailDataSource in project MVCHelper by LuckyJayce.
the class TestCaseFragment method getTestCaseDatas.
@Override
protected List<TestCaseData> getTestCaseDatas() {
List<TestCaseData> datas = new ArrayList<TestCaseData>();
TestCaseData caseData = new TestCaseData("测试登录", new LoginAsyncTask("LuckyJayce", "111"));
caseData.addParamGet(new String[] { "name", "password" }, new IAsyncTask<Map<String, String>>() {
@Override
public RequestHandle execute(ResponseSender<Map<String, String>> sender) throws Exception {
Map<String, String> map = new ArrayListMap<String, String>();
map.put("name", "nnnnn");
map.put("password", "ppppp");
sender.sendData(map);
return null;
}
});
datas.add(caseData);
datas.add(new TestCaseData("测试详情页", new BookDetailDataSource()));
datas.add(new TestCaseData("测试搜索文章", new SearchBookDataSource("Java")));
datas.add(new TestCaseData("测试文章列表", new BooksOkHttpNormal_DataSource()));
return datas;
}
use of com.shizhefei.test.models.datasource.BookDetailDataSource in project MVCHelper by LuckyJayce.
the class BookDetailActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bookdetail);
nameTextView = (TextView) findViewById(R.id.name_textView);
authorTextView = (TextView) findViewById(R.id.author_textView);
descriptionTextView = (TextView) findViewById(R.id.description_textView);
contentTextView = (TextView) findViewById(R.id.content_textView);
PtrClassicFrameLayout contentLayout = (PtrClassicFrameLayout) findViewById(R.id.rotate_header_list_view_frame);
mvcHelper = new MVCUltraHelper<Book>(contentLayout);
// 设置数据源
mvcHelper.setDataSource(new BookDetailDataSource());
// 设置适配器
mvcHelper.setAdapter(dataAdapter);
// 加载数据
mvcHelper.refresh();
}
use of com.shizhefei.test.models.datasource.BookDetailDataSource in project MVCHelper by LuckyJayce.
the class NormalActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_normal);
View contentLayout = findViewById(R.id.content_layout);
nameTextView = (TextView) findViewById(R.id.name_textView);
authorTextView = (TextView) findViewById(R.id.author_textView);
descriptionTextView = (TextView) findViewById(R.id.description_textView);
contentTextView = (TextView) findViewById(R.id.content_textView);
mvcHelper = new MVCNormalHelper<>(contentLayout);
// 设置数据源
mvcHelper.setDataSource(new BookDetailDataSource());
// 设置适配器
mvcHelper.setAdapter(dataAdapter);
// 加载数据
mvcHelper.refresh();
}
Aggregations