Android Open Source - DynamicCalendar Default Activity






From Project

Back to project page DynamicCalendar.

License

The source code is released under:

Apache License

If you think the Android project DynamicCalendar listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright (c) 2015. DineshPrasanth/*  www . j  a  v a2  s. c o  m*/
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.kd.dynamic.calendar;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;


public class DefaultActivity extends ActionBarActivity implements View.OnClickListener {

    Button mBasic;
    Button mTypeFace;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_default);

        mBasic = (Button) findViewById(R.id.btBasicDemo);
        mTypeFace = (Button) findViewById(R.id.btTypeFaceDemo);

        mBasic.setOnClickListener(this);
        mTypeFace.setOnClickListener(this);

    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_default, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_github) {
            Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(getResources().getString(R.string.github_source)));
            startActivity(browserIntent);
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    @Override
    public void onClick(View v) {
        Intent newIntent;
        switch (v.getId()) {
            case R.id.btBasicDemo:
                newIntent = new Intent(DefaultActivity.this, BasicActivity.class);
                startActivity(newIntent);
                break;

            case R.id.btTypeFaceDemo:
                newIntent = new Intent(DefaultActivity.this, TypeFaceActivity.class);
                startActivity(newIntent);
                break;
        }
    }
}




Java Source Code List

com.kd.dynamic.calendar.ApplicationTest.java
com.kd.dynamic.calendar.BasicActivity.java
com.kd.dynamic.calendar.DefaultActivity.java
com.kd.dynamic.calendar.TypeFaceActivity.java
com.kd.dynamic.calendar.generator.ApplicationTest.java
com.kd.dynamic.calendar.generator.ImageGenerator.java