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

简介: 该App主要是集合了CSDN  ,博客园 ,和51cto  以及myBait的部分博客的文章 现在分为几个部分来介绍该App 首先是介绍的是首页 :进入该页面后选择进入那个博客    源码: 该App已经上传到百度应用市场:http://shouji.baidu.com/soft/item?docid=8928185&from=as&f=searc

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

目录
相关文章
|
23天前
|
移动开发 前端开发 HTML5
HTML5实现酷炫个人产品推广、工具推广、信息推广、个人主页、个人介绍、酷炫官网、门户网站模板源码
HTML5实现酷炫个人产品推广、工具推广、信息推广、个人主页、个人介绍、酷炫官网、门户网站模板源码
|
6月前
|
前端开发
HTML+CSS实现小米官网首页(一)
HTML+CSS实现小米官网首页
|
6月前
|
前端开发
|
6月前
|
前端开发
HTML+CSS实现小米官网首页(二)
HTML+CSS实现小米官网首页
|
12月前
|
前端开发
淘宝主页+女装会场+详情页(html+css+js)
淘宝主页+女装会场+详情页(html+css+js)
122 0
|
存储 小程序 关系型数据库
微信商城小程序云开发版第5章,首页轮播图的实现
微信商城小程序云开发版第5章,首页轮播图的实现
158 0
|
前端开发
实训-利用HTML+CSS制作某米官网首页(二)
实训-利用HTML+CSS制作某米官网首页
213 0
实训-利用HTML+CSS制作某米官网首页(二)
|
前端开发
实训-利用HTML+CSS制作某米官网首页(一)
实训-利用HTML+CSS制作某米官网首页
294 0
实训-利用HTML+CSS制作某米官网首页(一)

热门文章

最新文章