该App主要是集合了CSDN ,博客园 ,和51cto 以及myBait的部分博客的文章
现在分为几个部分来介绍该App
首先是介绍的是首页 :进入该页面后选择进入那个博客
源码:
该App已经上传到百度应用市场:http://shouji.baidu.com/soft/item?docid=8928185&from=as&f=search_app_it%E8%B5%84%E8%AE%AF%40list_1_image%402%40header_all_input
有兴趣的可以下载看看。接下来我会公布源代码,不过该App并没有使用代码混淆,所以可以通过反编译清楚的看到源码。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:background="@drawable/backgroup"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center"> <ImageButton android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:id="@+id/csdn" android:src="@drawable/images" /> <ImageButton android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:id="@+id/cto" android:src="@drawable/cto"/> <ImageButton android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:id="@+id/blog_house" android:src="@drawable/blog_house"/> <ImageButton android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:id="@+id/iteye" android:src="@drawable/iteye"/> </LinearLayout> </LinearLayout>
public class SelectActivity extends BaseActivityImpl implements View.OnClickListener { private ImageButton csdn_img; private ImageButton cto_img; private ImageButton blog_houde_img; private ImageButton iteye_img; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.select); csdn_img = (ImageButton) findViewById(R.id.csdn); cto_img = (ImageButton) findViewById(R.id.cto); blog_houde_img = (ImageButton) findViewById(R.id.blog_house); iteye_img = (ImageButton) findViewById(R.id.iteye); csdn_img.setOnClickListener(this); cto_img.setOnClickListener(this); blog_houde_img.setOnClickListener(this); iteye_img.setOnClickListener(this); getCSDNApplication().addActivity(this); } @Override public void onClick(View v) { Intent intent = new Intent(); Bundle bundle = new Bundle(); intent.putExtra("IT", bundle); switch (v.getId()) { case R.id.csdn: bundle.putInt("information", 1); intent.setClass(this, FirstActivity.class); startActivity(intent); break; case R.id.cto: bundle.putInt("information", 2); intent.setClass(this, FirstActivity.class); startActivity(intent); break; case R.id.blog_house: bundle.putInt("information", 3); intent.setClass(this, FirstActivity.class); startActivity(intent); break; case R.id.iteye: bundle.putInt("information", 4); intent.setClass(this, FirstActivity.class); startActivity(intent); break; } } private long exitTime = 0; @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) { if ((System.currentTimeMillis() - exitTime) > 2000) { Toast.makeText(getApplicationContext(), "再按一次退出程序", Toast.LENGTH_SHORT).show(); exitTime = System.currentTimeMillis(); } else { getCSDNApplication().exit(); } return true; } else { return super.onKeyDown(keyCode, event); } }
时间: 2024-09-30 01:27:34