IT资讯--------------制作首页

该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);
        }
    }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值