bmob個(gè)人失物應(yīng)用_app開發(fā)模板
該源碼功能上非常單一,但請(qǐng)從源碼封裝及架構(gòu)的角度來看待。上傳此源碼主要有兩點(diǎn)目的:一、學(xué)習(xí)并體驗(yàn)Bmob云存儲(chǔ)二、站在架構(gòu)的角度,學(xué)習(xí)Android平臺(tái)下app開發(fā)過程中的整合【封裝】
源碼簡(jiǎn)介
該源碼功能上非常單一,但請(qǐng)從源碼封裝及架構(gòu)的角度來看待。
上傳此源碼主要有兩點(diǎn)目的:
一、學(xué)習(xí)并體驗(yàn)Bmob云存儲(chǔ)
二、站在架構(gòu)的角度,學(xué)習(xí)Android平臺(tái)下app開發(fā)過程中的整合【封裝】
源碼運(yùn)行截圖
源碼片段
源碼鏈接:http://down.51cto.com/data/1968339
- /**
- * 查詢?nèi)渴镄畔?nbsp;queryLosts
- *
- * @return void
- * @throws
- */
- private void queryLosts() {
- showView();
- BmobQuery<lost> query = new BmobQuery<lost>();
- query.order("-createdAt");// 按照時(shí)間降序
- query.findObjects(this, new FindListener<lost>() {
- @Override
- public void onSuccess(List<lost> losts) {
- // TODO Auto-generated method stub
- LostAdapter.clear();
- FoundAdapter.clear();
- if (losts == null || losts.size() == 0) {
- showErrorView(0);
- LostAdapter.notifyDataSetChanged();
- return;
- }
- progress.setVisibility(View.GONE);
- LostAdapter.addAll(losts);
- listview.setAdapter(LostAdapter);
- }
- @Override
- public void onError(int code, String arg0) {
- // TODO Auto-generated method stub
- showErrorView(0);
- }
- });
- }
- public void queryFounds() {
- showView();
- BmobQuery<found> query = new BmobQuery<found>();
- query.order("-createdAt");// 按照時(shí)間降序
- query.findObjects(this, new FindListener<found>() {
- @Override
- public void onSuccess(List<found> arg0) {
- // TODO Auto-generated method stub
- LostAdapter.clear();
- FoundAdapter.clear();
- if (arg0 == null || arg0.size() == 0) {
- showErrorView(1);
- FoundAdapter.notifyDataSetChanged();
- return;
- }
- FoundAdapter.addAll(arg0);
- listview.setAdapter(FoundAdapter);
- progress.setVisibility(View.GONE);
- }
- @Override
- public void onError(int code, String arg0) {
- // TODO Auto-generated method stub
- showErrorView(1);
- }
- });
- }
- ······
- /**
- * Add links into a TextView.
- * @param viewId The id of the TextView to linkify.
- * @return The BaseAdapterHelper for chaining.
- */
- public BaseAdapterHelper linkify(int viewId) {
- TextView view = retrieveView(viewId);
- Linkify.addLinks(view, Linkify.ALL);
- return this;
- }
- /** Apply the typeface to the given viewId */
- public BaseAdapterHelper setTypeface(int viewId, Typeface typeface) {
- TextView view = retrieveView(viewId);
- view.setTypeface(typeface);
- return this;
- }
- /** Apply the typeface to all the given viewIds */
- public BaseAdapterHelper setTypeface(Typeface typeface, int... viewIds) {
- for (int viewId : viewIds) {
- TextView view = retrieveView(viewId);
- view.setTypeface(typeface);
- }
- return this;
- }
- </found></found></found></found></lost></lost></lost></lost>
責(zé)任編輯:chenqingxiang
來源:
網(wǎng)絡(luò)整理