Skip to content

Commit ce46fed

Browse files
committed
added launch intents for menu items
1 parent bdc0c10 commit ce46fed

26 files changed

+312
-230
lines changed

.idea/workspace.xml

+259-210
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/app.iml

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
7878
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
7979
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
80+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/release" />
8081
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
8182
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
8283
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />

app/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<application
66
android:allowBackup="true"
7-
android:icon="@mipmap/app_launcher_2"
7+
android:icon="@mipmap/app_launcher"
88
android:label="@string/app_name"
99
android:supportsRtl="false"
1010
android:theme="@style/AppTheme" >

app/src/main/java/com/appeaser/sublimenavigationview/Sampler.java

+12-2
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,19 @@ public boolean onOptionsItemSelected(MenuItem item) {
216216
// as you specify a parent activity in AndroidManifest.xml.
217217
int id = item.getItemId();
218218

219-
//noinspection SimplifiableIfStatement
220219
if (id == R.id.action_rate_this_app) {
221-
220+
try {
221+
startActivity(new Intent(Intent.ACTION_VIEW,
222+
Uri.parse("market://details?id=com.appeaser.sublimenavigationview")));
223+
} catch (ActivityNotFoundException anfe1) {
224+
try {
225+
startActivity(new Intent(Intent.ACTION_VIEW,
226+
Uri.parse("http://market.android.com/details?id=com.appeaser.sublimenavigationview")));
227+
} catch (ActivityNotFoundException anfe2) {
228+
Toast.makeText(this, "You need a browser app to view this link",
229+
Toast.LENGTH_LONG).show();
230+
}
231+
}
222232
return true;
223233
} else if (id == R.id.action_github_link) {
224234
String data = "https://github.com/vikramkakkar/SublimeNavigationView";
-2.83 KB
Binary file not shown.
-201 Bytes
Loading
-3.34 KB
Binary file not shown.
-2.03 KB
Binary file not shown.
-39 Bytes
Loading
-2.15 KB
Binary file not shown.
-3.73 KB
Binary file not shown.
154 Bytes
Loading
-9.52 KB
Binary file not shown.
-4.73 KB
Binary file not shown.
-5.33 KB
Binary file not shown.
-338 Bytes
Loading
-7.54 KB
Binary file not shown.
-6.74 KB
Binary file not shown.
-457 Bytes
Loading
-10.2 KB
Binary file not shown.

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ buildscript {
66
}
77
dependencies {
88
classpath 'com.android.tools.build:gradle:1.3.0'
9+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.5'
910

1011
// NOTE: Do not place your application dependencies here; they belong
1112
// in the individual module build.gradle files
+30-12
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,39 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
}
5+
6+
dependencies {
7+
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
8+
}
9+
}
10+
111
apply plugin: 'com.android.library'
12+
apply plugin: 'com.github.dcendents.android-maven'
213

3-
/*ext {
14+
ext {
415
bintrayRepo = 'maven'
5-
bintrayName = 'sublime-picker'
16+
bintrayName = 'sublime-nav-view'
617

7-
publishedGroupId = 'com.appeaser.sublimepickerlibrary'
8-
libraryName = 'SublimePicker'
9-
artifact = 'sublimepickerlibrary'
18+
publishedGroupId = 'com.appeaser.sublimenavigationviewlibrary'
19+
libraryName = 'SublimeNavigationView'
20+
artifact = 'sublimenavigationviewlibrary'
1021

11-
libraryDescription = 'A material-styled android view that provisions picking of a date, time & recurrence option, all from a single user-interface.'
22+
libraryDescription = 'SublimeNavigationView is a complete rewrite of NavigationView (from Design Support library) that enables usage of Checkboxes, Switches & Badges as menu items. Menus are defined in XML, and parsed using a custom MenuInflater. SublimeNavigationView works with Parcelable Menus which means that state retention is built-in. Moreover, it can support multiple menus while preserving their respective states. Groups added to the Menu have the added feature of being collapsible/expandable. Along with this, SublimeNavigationView allows a few options for custom styling.'
1223

13-
siteUrl = 'https://github.com/vikramkakkar/SublimePicker'
14-
gitUrl = 'https://github.com/vikramkakkar/SublimePicker.git'
24+
siteUrl = 'https://github.com/vikramkakkar/SublimeNavigationView'
25+
gitUrl = 'https://github.com/vikramkakkar/SublimeNavigationView.git'
1526

16-
libraryVersion = '1.0.0'
27+
libraryVersion = '0.0.1'
1728

1829
developerId = 'vikramkakkar'
1930
developerName = 'Vikram Kakkar'
20-
developerEmail = 'vikram.kakkar.85@gmail.com'
31+
developerEmail = 'vikram.kakkar.01@gmail.com'
2132

2233
licenseName = 'The Apache Software License, Version 2.0'
2334
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
2435
allLicenses = ["Apache-2.0"]
25-
}*/
36+
}
2637

2738
android {
2839
compileSdkVersion 23
@@ -40,11 +51,18 @@ android {
4051
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
4152
}
4253
}
54+
compileOptions {
55+
sourceCompatibility JavaVersion.VERSION_1_7
56+
}
4357
}
4458

4559
dependencies {
46-
compile fileTree(dir: 'libs', include: ['*.jar'])
60+
compile fileTree(include: ['*.jar'], dir: 'libs')
4761
testCompile 'junit:junit:4.12'
4862
compile 'com.android.support:appcompat-v7:23.1.1'
4963
compile 'com.android.support:recyclerview-v7:23.1.1'
64+
compile 'com.android.support:support-annotations:23.1.1'
5065
}
66+
67+
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
68+
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'

sublimenavigationviewlibrary/src/main/java/com/appeaser/sublimenavigationviewlibrary/StateAwareTextView.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import android.widget.TextView;
2525

2626
/**
27-
* Sub-classed TextView that responds to custom states & style attrs.
27+
* Sub-classed TextView that responds to custom states &amp; style attrs.
2828
*/
2929
public class StateAwareTextView extends TextView {
3030

sublimenavigationviewlibrary/src/main/java/com/appeaser/sublimenavigationviewlibrary/SublimeMenu.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ public boolean invoke() {
8383

8484
/**
8585
* Called by menu to notify of close and selection changes.
86-
*
87-
* @hide
8886
*/
8987
public interface Callback {
9088

@@ -1034,7 +1032,7 @@ private void prepareMenuItems() {
10341032

10351033
/**
10361034
* Called when an item is changed. Type of change is evaluated
1037-
* by comparing the 'old' position & the 'new' position of the item.
1035+
* by comparing the 'old' position &amp; the 'new' position of the item.
10381036
*
10391037
* @param itemId id of item that's been changed
10401038
*/

sublimenavigationviewlibrary/src/main/java/com/appeaser/sublimenavigationviewlibrary/SublimeMenuInflater.java

+2
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ public class SublimeMenuInflater {
8080

8181
/**
8282
* Constructs a menu inflater.
83+
*
84+
* @param context Context of the calling entity.
8385
*/
8486
public SublimeMenuInflater(Context context) {
8587
mContext = context;

sublimenavigationviewlibrary/sublimenavigationviewlibrary.iml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<module external.linked.project.id=":sublimenavigationviewlibrary" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="SublimeNavigationView" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
2+
<module external.linked.project.id=":sublimenavigationviewlibrary" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="com.appeaser.sublimenavigationviewlibrary" external.system.module.version="0.0.1" type="JAVA_MODULE" version="4">
33
<component name="FacetManager">
44
<facet type="android-gradle" name="Android-Gradle">
55
<configuration>
@@ -65,6 +65,7 @@
6565
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
6666
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
6767
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
68+
<excludeFolder url="file://$MODULE_DIR$/build/docs" />
6869
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotations" />
6970
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
7071
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
@@ -75,7 +76,9 @@
7576
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
7677
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
7778
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
79+
<excludeFolder url="file://$MODULE_DIR$/build/libs" />
7880
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
81+
<excludeFolder url="file://$MODULE_DIR$/build/poms" />
7982
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
8083
</content>
8184
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />

0 commit comments

Comments
 (0)