Skip to content

Commit accf42c

Browse files
author
Nilanchal Panigrahy
committed
Consolidated all UI examples into single repo
1 parent 5e38bef commit accf42c

File tree

28 files changed

+823
-0
lines changed

28 files changed

+823
-0
lines changed
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="java-gradle" name="Java-Gradle">
5+
<configuration>
6+
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
7+
</configuration>
8+
</facet>
9+
</component>
10+
<component name="NewModuleRootManager" inherit-compiler-output="false">
11+
<output url="file://$MODULE_DIR$/build/classes/main" />
12+
<output-test url="file://$MODULE_DIR$/build/classes/test" />
13+
<exclude-output />
14+
<content url="file://$MODULE_DIR$">
15+
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
16+
</content>
17+
<orderEntry type="inheritedJdk" />
18+
<orderEntry type="sourceFolder" forTests="false" />
19+
</component>
20+
</module>
21+

Android-RadioButton-Example/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Android-RadioButton-Example
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="android-gradle" name="Android-Gradle">
5+
<configuration>
6+
<option name="GRADLE_PROJECT_PATH" value=":app" />
7+
</configuration>
8+
</facet>
9+
<facet type="android" name="Android">
10+
<configuration>
11+
<option name="SELECTED_BUILD_VARIANT" value="debug" />
12+
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
13+
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
14+
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" />
15+
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
16+
<option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugTestSources" />
17+
<option name="ALLOW_USER_CONFIGURATION" value="false" />
18+
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
19+
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
20+
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
21+
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
22+
</configuration>
23+
</facet>
24+
</component>
25+
<component name="NewModuleRootManager" inherit-compiler-output="false">
26+
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
27+
<exclude-output />
28+
<content url="file://$MODULE_DIR$">
29+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
30+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
31+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
32+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
33+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
34+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
35+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/test/debug" isTestSource="true" generated="true" />
36+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/test/debug" isTestSource="true" generated="true" />
37+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/test/debug" isTestSource="true" generated="true" />
38+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/test/debug" isTestSource="true" generated="true" />
39+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/test/debug" type="java-test-resource" />
40+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/test/debug" type="java-test-resource" />
41+
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
42+
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
43+
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
44+
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
45+
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
46+
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
47+
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
48+
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
49+
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
50+
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
51+
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
52+
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
53+
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
54+
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
55+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
56+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
57+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
58+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
59+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
60+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
61+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
62+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
63+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
64+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
65+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
66+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
67+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
68+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
69+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
70+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
71+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
72+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
73+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
74+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
75+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
76+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
77+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
78+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
79+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
80+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
81+
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
82+
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
83+
</content>
84+
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
85+
<orderEntry type="sourceFolder" forTests="false" />
86+
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
87+
<orderEntry type="library" exported="" name="support-annotations-21.0.3" level="project" />
88+
<orderEntry type="library" exported="" name="support-v4-21.0.3" level="project" />
89+
</component>
90+
</module>
91+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 21
5+
buildToolsVersion "21.1.2"
6+
7+
defaultConfig {
8+
applicationId "com.example.myapplication"
9+
minSdkVersion 15
10+
targetSdkVersion 21
11+
versionCode 1
12+
versionName "1.0"
13+
}
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18+
}
19+
}
20+
}
21+
22+
dependencies {
23+
compile fileTree(dir: 'libs', include: ['*.jar'])
24+
compile "com.android.support:appcompat-v7:21.0.+"
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/nilanchalpanigrahy/Library/Android/sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.example.myapplication;
2+
3+
import android.app.Application;
4+
import android.test.ApplicationTestCase;
5+
6+
/**
7+
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
8+
*/
9+
public class ApplicationTest extends ApplicationTestCase<Application> {
10+
public ApplicationTest() {
11+
super(Application.class);
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.example.myapplication">
4+
5+
6+
<uses-permission android:name="android.permission.INTERNET" />
7+
8+
<application
9+
android:allowBackup="true"
10+
android:icon="@drawable/ic_launcher"
11+
android:label="@string/app_name"
12+
android:theme="@style/AppTheme">
13+
14+
15+
<activity
16+
android:name=".MainActivity"
17+
android:label="@string/app_name">
18+
<intent-filter>
19+
<action android:name="android.intent.action.MAIN" />
20+
21+
<category android:name="android.intent.category.LAUNCHER" />
22+
</intent-filter>
23+
</activity>
24+
</application>
25+
26+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package com.example.myapplication;
2+
3+
import android.app.Activity;
4+
import android.os.Bundle;
5+
import android.view.View;
6+
import android.widget.RadioButton;
7+
import android.widget.RadioGroup;
8+
import android.widget.Toast;
9+
10+
public class MainActivity extends Activity {
11+
private RadioGroup radioGroup;
12+
13+
@Override
14+
protected void onCreate(Bundle savedInstanceState) {
15+
super.onCreate(savedInstanceState);
16+
setContentView(R.layout.activity_main);
17+
18+
/* Initialize Radio Group and attach click handler */
19+
radioGroup = (RadioGroup) findViewById(R.id.radioGroup);
20+
radioGroup.clearCheck();
21+
22+
/* Attach CheckedChangeListener to radio group */
23+
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
24+
@Override
25+
public void onCheckedChanged(RadioGroup group, int checkedId) {
26+
RadioButton rb = (RadioButton) group.findViewById(checkedId);
27+
if(null!=rb && checkedId > -1){
28+
Toast.makeText(MainActivity.this, rb.getText(), Toast.LENGTH_SHORT).show();
29+
}
30+
31+
}
32+
});
33+
}
34+
35+
public void onClear(View v) {
36+
/* Clears all selected radio buttons to default */
37+
radioGroup.clearCheck();
38+
}
39+
40+
public void onSubmit(View v) {
41+
RadioButton rb = (RadioButton) radioGroup.findViewById(radioGroup.getCheckedRadioButtonId());
42+
Toast.makeText(MainActivity.this, rb.getText(), Toast.LENGTH_SHORT).show();
43+
}
44+
}
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:layout_width="fill_parent"
3+
android:layout_height="wrap_content"
4+
android:orientation="vertical"
5+
android:padding="20dp">
6+
7+
<TextView
8+
android:layout_width="fill_parent"
9+
android:layout_height="wrap_content"
10+
android:text="How do you like the quality of our tutorials?"
11+
android:textAppearance="?android:attr/textAppearanceLarge" />
12+
13+
<RadioGroup
14+
android:id="@+id/radioGroup"
15+
android:layout_width="fill_parent"
16+
android:layout_height="wrap_content"
17+
android:orientation="vertical">
18+
19+
<RadioButton
20+
android:id="@+id/radioButton1"
21+
android:layout_width="fill_parent"
22+
android:layout_height="wrap_content"
23+
android:text="Excellent " />
24+
25+
<RadioButton
26+
android:id="@+id/radioButton2"
27+
android:layout_width="fill_parent"
28+
android:layout_height="wrap_content"
29+
android:text="Satisfactory" />
30+
31+
<RadioButton
32+
android:id="@+id/radioButton3"
33+
android:layout_width="fill_parent"
34+
android:layout_height="wrap_content"
35+
android:text="Below Average" />
36+
</RadioGroup>
37+
38+
<LinearLayout
39+
android:layout_width="fill_parent"
40+
android:layout_height="wrap_content"
41+
android:orientation="horizontal">
42+
43+
<Button
44+
android:id="@+id/clearBtn"
45+
android:layout_width="match_parent"
46+
android:layout_height="wrap_content"
47+
android:layout_weight="1"
48+
android:onClick="onClear"
49+
android:text="Clear " />
50+
51+
<Button
52+
android:id="@+id/submitBtn"
53+
android:layout_width="match_parent"
54+
android:layout_height="wrap_content"
55+
android:layout_weight="1"
56+
android:onClick="onSubmit"
57+
android:text="Submit" />
58+
</LinearLayout>
59+
60+
</LinearLayout>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<menu xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:app="http://schemas.android.com/apk/res-auto"
3+
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
4+
<item android:id="@+id/action_settings" android:title="@string/action_settings"
5+
android:orderInCategory="100" app:showAsAction="never" />
6+
</menu>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<resources>
2+
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
3+
(such as screen margins) for screens with more than 820dp of available width. This
4+
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
5+
<dimen name="activity_horizontal_margin">64dp</dimen>
6+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="red">#F44336</color>
4+
5+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<resources>
2+
<!-- Default screen margins, per the Android Design guidelines. -->
3+
<dimen name="activity_horizontal_margin">16dp</dimen>
4+
<dimen name="activity_vertical_margin">16dp</dimen>
5+
6+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
4+
<string name="app_name">My Application</string>
5+
<string name="hello_world">Hello world!</string>
6+
<string name="action_settings">Settings</string>
7+
8+
9+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<resources>
2+
3+
<!-- Base application theme. -->
4+
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
5+
<!-- Customize your theme here. -->
6+
</style>
7+
8+
9+
10+
</resources>
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
buildscript {
4+
repositories {
5+
jcenter()
6+
}
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:1.0.0'
9+
10+
// NOTE: Do not place your application dependencies here; they belong
11+
// in the individual module build.gradle files
12+
}
13+
}
14+
15+
allprojects {
16+
repositories {
17+
jcenter()
18+
}
19+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Wed Apr 10 15:27:10 PDT 2013
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip

0 commit comments

Comments
 (0)