Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

UI widgets I use across my apps.

branch: master

build.gradle

Change-Id: Ifb6363e847e41929f5fafcac9af0067b2637b493
latest commit 2cc45f35f5
Koushik Dutta authored May 30, 2013
Octocat-spinner-32 Widgets build.gradle May 30, 2013
Octocat-spinner-32 WidgetsSample android studio May 16, 2013
Octocat-spinner-32 .gitignore remove gen February 23, 2013
Octocat-spinner-32 LICENSE LICENSE March 01, 2013
Octocat-spinner-32 README.md Update README.md January 12, 2013
Octocat-spinner-32 dark.png resize January 12, 2013
Octocat-spinner-32 light.png resize January 12, 2013
README.md

To do this:

Write this:

public class MainActivity extends ActivityBase {
    @Override
    public void onCreate(Bundle savedInstanceState, View view) {
        super.onCreate(savedInstanceState, view);

        addItem("Theme", new ListItem(getFragment(), "Dark Theme", null, R.drawable.ic_launcher) {
            @Override
            public void onClick(View view) {
                super.onClick(view);
                startActivity(new Intent(MainActivity.this, MainActivityDark.class));
            }
        });

        addItem(R.string.cloud, new ListItem(getFragment(), R.string.googledrive, R.string.googledrive_summary, R.drawable.drive) {
            @Override
            public void onClick(View view) {
                super.onClick(view);
                Toast.makeText(MainActivity.this, "You clicked Google Drive!", Toast.LENGTH_SHORT).show();
            }
        });
        addItem(R.string.cloud, new ListItem(getFragment(), R.string.dropbox, 0, R.drawable.dropbox));
        addItem(R.string.cloud, new ListItem(getFragment(), R.string.box, 0, R.drawable.box));

        addItem(R.string.devices, new ListItem(getFragment(), "Nexus S", null, R.drawable.nexusone)).setCheckboxVisible(true).setChecked(true);
        addItem(R.string.devices, new ListItem(getFragment(), "Nexus One", null, R.drawable.nexusone)).setCheckboxVisible(true);
        addItem(R.string.devices, new ListItem(getFragment(), "Nexus 4", null, R.drawable.nexusone)).setCheckboxVisible(true);
        addItem(R.string.devices, new ListItem(getFragment(), "Nexus 7", null, R.drawable.nexusone)).setCheckboxVisible(true).setChecked(true);;
        addItem(R.string.devices, new ListItem(getFragment(), "Nexus 10", null, R.drawable.nexusone)).setCheckboxVisible(true);
    }
}


Something went wrong with that request. Please try again.