diff --git a/app/build.gradle b/app/build.gradle
index 037cbb3..a0bbd26 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -19,6 +19,19 @@ android {
applicationIdSuffix ".debug"
}
}
+
+ flavorDimensions "default"
+
+ productFlavors {
+ // Free version
+ free {
+ applicationId = "oi.caster.wickedcool"
+ }
+ // Pro version
+ pro {
+ applicationId = "oi.caster.wickedcool.pro"
+ }
+ }
}
dependencies {
diff --git a/app/src/free/java/io/caster/wickedcool/util/ProHelperImpl.java b/app/src/free/java/io/caster/wickedcool/util/ProHelperImpl.java
new file mode 100644
index 0000000..ab06274
--- /dev/null
+++ b/app/src/free/java/io/caster/wickedcool/util/ProHelperImpl.java
@@ -0,0 +1,9 @@
+package io.caster.wickedcool.util;
+
+public class ProHelperImpl implements ProHelper {
+ @Override
+ public boolean isPro() {
+ // This is the free version man, not the pro version!!!!
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 1472d74..4add9ca 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -7,15 +7,15 @@
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
+
-
-
+ android:label="@string/app_name">
-
+
+
+
-
-
+
\ No newline at end of file
diff --git a/app/src/main/java/io/caster/wickedcool/NavigationDrawerFragment.java b/app/src/main/java/io/caster/wickedcool/NavigationDrawerFragment.java
index 5da0bc7..a0e5ae2 100644
--- a/app/src/main/java/io/caster/wickedcool/NavigationDrawerFragment.java
+++ b/app/src/main/java/io/caster/wickedcool/NavigationDrawerFragment.java
@@ -20,8 +20,12 @@
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
+import android.widget.TextView;
import android.widget.Toast;
+import io.caster.wickedcool.util.ProHelper;
+import io.caster.wickedcool.util.ProHelperImpl;
+
/**
* Fragment used for managing interactions for and presentation of a navigation drawer.
* See the
@@ -84,30 +88,35 @@ public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
// Indicate that this fragment would like to influence the set of actions in the action bar.
setHasOptionsMenu(true);
+
+ ProHelper proHelper = new ProHelperImpl();
+ TextView metadata = getView().findViewById(R.id.metadata);
+ metadata.setText("Is Pro: " + Boolean.toString(proHelper.isPro()));
}
@Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- mDrawerListView = (ListView) inflater.inflate(
- R.layout.fragment_navigation_drawer, container, false);
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ /*
+ mDrawerListView = (ListView) inflater.inflate(R.layout.fragment_navigation_drawer, container, false);
mDrawerListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView> parent, View view, int position, long id) {
selectItem(position);
}
});
- mDrawerListView.setAdapter(new ArrayAdapter(
- getActionBar().getThemedContext(),
- android.R.layout.simple_list_item_activated_1,
- android.R.id.text1,
- new String[]{
- getString(R.string.title_section1),
- getString(R.string.title_section2),
- getString(R.string.title_section3),
- }));
+ mDrawerListView.setAdapter(new ArrayAdapter<>(getActionBar().getThemedContext(),
+ android.R.layout.simple_list_item_activated_1,
+ android.R.id.text1,
+ new String[] {
+ getString(R.string.title_section1),
+ getString(R.string.title_section2),
+ getString(R.string.title_section3),
+ }));
mDrawerListView.setItemChecked(mCurrentSelectedPosition, true);
return mDrawerListView;
+ */
+ View rootView = inflater.inflate(R.layout.fragment_main, container, false);
+ return rootView;
}
public boolean isDrawerOpen() {
@@ -246,12 +255,10 @@ public boolean onOptionsItemSelected(MenuItem item) {
if (mDrawerToggle.onOptionsItemSelected(item)) {
return true;
}
-
if (item.getItemId() == R.id.action_example) {
Toast.makeText(getActivity(), "Example action.", Toast.LENGTH_SHORT).show();
return true;
}
-
return super.onOptionsItemSelected(item);
}
@@ -279,4 +286,4 @@ public static interface NavigationDrawerCallbacks {
*/
void onNavigationDrawerItemSelected(int position);
}
-}
+}
\ No newline at end of file
diff --git a/app/src/main/java/io/caster/wickedcool/util/ProHelper.java b/app/src/main/java/io/caster/wickedcool/util/ProHelper.java
new file mode 100644
index 0000000..36a1de3
--- /dev/null
+++ b/app/src/main/java/io/caster/wickedcool/util/ProHelper.java
@@ -0,0 +1,5 @@
+package io.caster.wickedcool.util;
+
+public interface ProHelper {
+ boolean isPro();
+}
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index df73618..8fddca2 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -1,6 +1,5 @@
-
+ android:layout_height="match_parent" />
-
-
-
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_main.xml b/app/src/main/res/layout/fragment_main.xml
index ef7a821..311673a 100644
--- a/app/src/main/res/layout/fragment_main.xml
+++ b/app/src/main/res/layout/fragment_main.xml
@@ -1,16 +1,15 @@
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ tools:context=".MainActivity$PlaceholderFragment">
-
-
+ android:layout_height="wrap_content" />
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_navigation_drawer.xml b/app/src/main/res/layout/fragment_navigation_drawer.xml
index 080c4da..02fafae 100644
--- a/app/src/main/res/layout/fragment_navigation_drawer.xml
+++ b/app/src/main/res/layout/fragment_navigation_drawer.xml
@@ -1,9 +1,9 @@
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="#cccc"
+ android:choiceMode="singleChoice"
+ android:divider="@android:color/transparent"
+ android:dividerHeight="0dp"
+ tools:context=".NavigationDrawerFragment" />
\ No newline at end of file
diff --git a/app/src/pro/java/io/caster/wickedcool/util/ProHelperImpl.java b/app/src/pro/java/io/caster/wickedcool/util/ProHelperImpl.java
new file mode 100644
index 0000000..e5ff652
--- /dev/null
+++ b/app/src/pro/java/io/caster/wickedcool/util/ProHelperImpl.java
@@ -0,0 +1,9 @@
+package io.caster.wickedcool.util;
+
+public class ProHelperImpl implements ProHelper {
+ @Override
+ public boolean isPro() {
+ // Heck yes, this is the pro version.
+ return true;
+ }
+}
\ No newline at end of file