Android Open Source - savemypics C Snapfish Settings Activity






From Project

Back to project page savemypics.

License

The source code is released under:

Copyright (c) 2014, KB Sriram All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. R...

If you think the Android project savemypics 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

package org.savemypics.android.activity;
// w  ww .j  ava 2 s  . co  m
import android.content.res.Resources;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.LinearLayout;
import org.savemypics.android.R;
import org.savemypics.android.util.CUtils;

public class CSnapfishSettingsActivity extends ABaseSettingsActivity
{
    @Override
    protected void onCreate(Bundle saved)
    {
        super.onCreate(saved);
        LayoutInflater inflater = getLayoutInflater();
        DisplayMetrics metrics = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(metrics);

        View divider = inflater.inflate(R.layout.view_divider, null);
        // height = 1sp
        int ht = (int) (0.5f + TypedValue.applyDimension
                        (TypedValue.COMPLEX_UNIT_SP, 1f, metrics));
        if (ht < 1) { ht = 1; }
        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams
            (LinearLayout.LayoutParams.MATCH_PARENT, ht);

        divider.setLayoutParams(lp);
        getMainViewGroup().addView(divider);

        m_include_shared = (ViewGroup)
            inflater.inflate(R.layout.checkbox_preference, null);
        lp = new LinearLayout.LayoutParams
            (LinearLayout.LayoutParams.MATCH_PARENT,
             LinearLayout.LayoutParams.WRAP_CONTENT);
        Resources res = getResources();
        lp.topMargin = res.getDimensionPixelSize(R.dimen.grid_b_2_3);
        lp.bottomMargin = res.getDimensionPixelSize(R.dimen.grid_b_6);
        m_include_shared.setLayoutParams(lp);

        getMainViewGroup().addView(m_include_shared);
        m_include_shared_cb = setCheckBoxPreference
            (m_include_shared,
             R.string.pref_download_shared_title,
             R.string.pref_download_shared_summary);
    }

    @Override
    protected void onResume()
    {
        super.onResume();
        setCheckBoxCallback
            (m_include_shared_cb,
             getBooleanPreference(CUtils.PREF_DOWNLOAD_SHARED_SNAPFISH, false),
             new View.OnClickListener() {
                 public void onClick(View v) {
                     setBooleanPreference
                         (CUtils.PREF_DOWNLOAD_SHARED_SNAPFISH,
                          ((CheckBox) v).isChecked());
                 }
             });
    }

    @Override
    protected void onPause()
    {
        super.onPause();
        m_include_shared_cb.setOnClickListener(null);
    }

    @Override
    protected String getAccountType()
    { return CUtils.SNAPFISH_ACCOUNT_TYPE; }
    @Override
    protected int getAccountDrawableId()
    { return R.drawable.snapfish_icon; }

    @Override
    protected void onSetDownloadEnabled(boolean curval)
    { setEnabled(m_include_shared, curval); }

    private ViewGroup m_include_shared;
    private CheckBox m_include_shared_cb;
}




Java Source Code List

android.util.Base64.java
org.savemypics.android.activity.AActivity.java
org.savemypics.android.activity.ABaseSettingsActivity.java
org.savemypics.android.activity.CAccountInfoListAdapter.java
org.savemypics.android.activity.CFlickrSettingsActivity.java
org.savemypics.android.activity.CSnapfishSettingsActivity.java
org.savemypics.android.activity.CStartActivity.java
org.savemypics.android.authenticator.AAuthenticatorActivity.java
org.savemypics.android.authenticator.CAuthenticationService.java
org.savemypics.android.authenticator.CAuthenticator.java
org.savemypics.android.authenticator.CFlickrLoginHookActivity.java
org.savemypics.android.authenticator.CFlickrWebActivity.java
org.savemypics.android.authenticator.CSelectProviderActivity.java
org.savemypics.android.authenticator.CSnapfishLoginActivity.java
org.savemypics.android.db.CAccount.java
org.savemypics.android.db.CDb.java
org.savemypics.android.db.CLocalImage.java
org.savemypics.android.db.CMap.java
org.savemypics.android.db.CRemoteImage.java
org.savemypics.android.event.AEvent.java
org.savemypics.android.event.CEventBus.java
org.savemypics.android.event.CExceptionEvent.java
org.savemypics.android.glue.ABaseGlue.java
org.savemypics.android.glue.CFlickrGlue.java
org.savemypics.android.glue.CSnapfishGlue.java
org.savemypics.android.receiver.CNetworkChangeReceiver.java
org.savemypics.android.service.CTaskQueue.java
org.savemypics.android.sync.CMediaUtils.java
org.savemypics.android.sync.CSyncAdapter.java
org.savemypics.android.sync.CSyncService.java
org.savemypics.android.sync.CSyncUtils.java
org.savemypics.android.util.CBitmapUtils.java
org.savemypics.android.util.CFileCache.java
org.savemypics.android.util.CLruCache.java
org.savemypics.android.util.CUtils.java
org.savemypics.android.util.CUtils.java
org.savemypics.android.view.CMaximumWidthLayout.java
org.savemypics.android.view.CModularLayout.java
org.savemypics.android.view.CRefreshButton.java
org.savemypics.android.view.CRoundedBitmapView.java
org.savemypics.android.view.CStatusCounterView.java
org.savemypics.plugin.CIOUtils.java
org.savemypics.plugin.CPlugin.java
org.savemypics.plugin.flickr.CFlickrAlbum.java
org.savemypics.plugin.flickr.CFlickrUtils.java
org.savemypics.plugin.snapfish.CSnapfishAlbum.java
org.savemypics.plugin.snapfish.CSnapfishFeed.java
org.savemypics.plugin.snapfish.CSnapfishUser.java
org.savemypics.plugin.snapfish.CSnapfishUtils.java