Android Open Source - android_WallBox About Activity






From Project

Back to project page android_WallBox.

License

The source code is released under:

Apache License

If you think the Android project android_WallBox 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 2014 Jeremie Long/*w w w . j a v a2 s  .  co 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.lithidsw.wallbox;

import android.app.ActionBar;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageButton;

import com.lithidsw.wallbox.utils.C;
import com.lithidsw.wallbox.utils.ContribDialog;
import com.lithidsw.wallbox.utils.Utils;

public class AboutActivity extends Activity implements View.OnClickListener, View.OnLongClickListener{

    SharedPreferences prefs;
    Context mContext;
    private Utils mUtils;
    private ImageButton btn_googleplus;
    private ImageButton btn_contribute;
    private ImageButton btn_changelog;
    private ImageButton btn_donate;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        prefs = getSharedPreferences(C.PREF, MODE_PRIVATE);
        String themeSty = prefs.getString(C.PREF_THEME, null);
        if (themeSty != null) {
            setTheme(getResources().getIdentifier(themeSty, "style", C.THIS));
        } else {
            setTheme(C.DEFAULT_THEME);
        }
        super.onCreate(savedInstanceState);
        setContentView(R.layout.about_frag);
        setupActionBar();
        mContext = this;
        mUtils = new Utils(mContext);
        btn_googleplus = (ImageButton) findViewById(R.id.btn_googleplus);
        btn_contribute = (ImageButton) findViewById(R.id.btn_contribute);
        btn_changelog = (ImageButton) findViewById(R.id.btn_changelog);
        btn_donate = (ImageButton) findViewById(R.id.btn_donate);
        btn_googleplus.setOnClickListener(this);
        btn_contribute.setOnClickListener(this);
        btn_changelog.setOnClickListener(this);
        btn_donate.setOnClickListener(this);
        btn_googleplus.setOnLongClickListener(this);
        btn_contribute.setOnLongClickListener(this);
        btn_changelog.setOnLongClickListener(this);
        btn_donate.setOnLongClickListener(this);
    }

    private void setupActionBar() {
        ActionBar actionBar = getActionBar();
        if (actionBar != null) {
            actionBar.setDisplayHomeAsUpEnabled(true);
        }
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                finish();
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_googleplus:
                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://plus.google.com/u/0/communities/104381277142730834991")));
                break;
            case R.id.btn_contribute:
                new ContribDialog(mContext).showContribAlert(0);
                break;
            case R.id.btn_changelog:
                new ContribDialog(mContext).showContribAlert(1);
                break;
            case R.id.btn_donate:
                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://goo.gl/511ca")));
                break;
        }
    }

    @Override
    public boolean onLongClick(View view) {
        switch (view.getId()) {
            case R.id.btn_googleplus:
                mUtils.sendToast(getString(R.string.googleplus));
                return true;
            case R.id.btn_contribute:
                mUtils.sendToast(getString(R.string.contribute));
                return true;
            case R.id.btn_changelog:
                mUtils.sendToast(getString(R.string.changelog));
                return true;
            case R.id.btn_donate:
                mUtils.sendToast(getString(R.string.donate));
                return true;
        }
        return false;
    }
}




Java Source Code List

com.lithidsw.wallbox.AboutActivity.java
com.lithidsw.wallbox.ActionReceiver.java
com.lithidsw.wallbox.MainActivity.java
com.lithidsw.wallbox.app.colorwall.ColorWallFrag.java
com.lithidsw.wallbox.app.randomizer.RandomizerFrag.java
com.lithidsw.wallbox.app.randomizer.adapter.RandomizerGridAdapter.java
com.lithidsw.wallbox.app.randomizer.db.DBHelper.java
com.lithidsw.wallbox.app.randomizer.db.TableHelper.java
com.lithidsw.wallbox.app.saturate.SaturateFrag.java
com.lithidsw.wallbox.app.theme.ThemeFragment.java
com.lithidsw.wallbox.app.theme.ThemesMainFragment.java
com.lithidsw.wallbox.app.wallsnap.WallSnapActivity.java
com.lithidsw.wallbox.app.wallsnap.WallSnapFragment.java
com.lithidsw.wallbox.app.wallsnap.WallpaperFragment.java
com.lithidsw.wallbox.app.wallsnap.adapters.WallpaperAdapter.java
com.lithidsw.wallbox.loader.ImageLoader.java
com.lithidsw.wallbox.loader.MemoryCache.java
com.lithidsw.wallbox.utils.BitMapBlur.java
com.lithidsw.wallbox.utils.C.java
com.lithidsw.wallbox.utils.ColorFilterGenerator.java
com.lithidsw.wallbox.utils.ContribDialog.java
com.lithidsw.wallbox.utils.CustomDialogs.java
com.lithidsw.wallbox.utils.DateBuilder.java
com.lithidsw.wallbox.utils.JsonHelper.java
com.lithidsw.wallbox.utils.MenuHelper.java
com.lithidsw.wallbox.utils.Utils.java