Skip to content
This repository has been archived by the owner on Sep 28, 2018. It is now read-only.

Commit

Permalink
Include Support library
Browse files Browse the repository at this point in the history
  • Loading branch information
charbgr committed Nov 3, 2014
1 parent 1e193b3 commit 882ec4e
Show file tree
Hide file tree
Showing 15 changed files with 399 additions and 62 deletions.
15 changes: 8 additions & 7 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugJava" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" />
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
<option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugTestSources" />
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
Expand All @@ -37,22 +38,22 @@
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/test/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
Expand All @@ -77,11 +78,11 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
</content>
<orderEntry type="jdk" jdkName="Android API 20 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="appcompat-v7-20.0.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-20.0.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-20.0.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-21.0.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-21.0.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-21.0.0" level="project" />
<orderEntry type="module" module-name="library" exported="" />
</component>
</module>
Expand Down
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
compileSdkVersion 21
buildToolsVersion "21.0.2"

defaultConfig {
applicationId "com.charbgr.BlurNavigationDrawer.sample.app"
minSdkVersion 10
targetSdkVersion 19
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
Expand All @@ -20,6 +20,6 @@ android {
}

dependencies {
compile 'com.android.support:appcompat-v7:20.0.0'
compile 'com.android.support:appcompat-v7:21.0.0'
compile project(':library')
}
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
movies.add(new Movie(res.getDrawable(R.drawable.poster_prisoners), "Prisoners"));
movies.add(new Movie(res.getDrawable(R.drawable.poster_runner_runner), "Runner Runner"));
movies.add(new Movie(res.getDrawable(R.drawable.poster_the_counselor), "The counselor"));
movies.add(new Movie(res.getDrawable(R.drawable.poster_thor), "About Time"));
movies.add(new Movie(res.getDrawable(R.drawable.poster_thor), "Thor"));



Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package com.charbgr.BlurNavigationDrawer.sample.app;

import android.app.AlertDialog;
import android.graphics.Color;
import android.support.v7.app.ActionBarActivity;
import android.app.Activity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.content.SharedPreferences;
Expand All @@ -22,10 +20,9 @@
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

import com.charbgr.BlurNavigationDrawer.library.BlurActionBarDrawerToggle;
import com.charbgr.BlurNavigationDrawer.library.BlurDrawerLayout;
import com.charbgr.BlurNavigationDrawer.v4.BlurActionBarDrawerToggle;
import com.charbgr.BlurNavigationDrawer.v4.BlurDrawerLayout;


/**
Expand Down Expand Up @@ -95,8 +92,10 @@ public void onActivityCreated (Bundle savedInstanceState) {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
mDrawerListView = (ListView) inflater.inflate(

View v = inflater.inflate(
R.layout.fragment_navigation_drawer, container, false);
mDrawerListView = (ListView) v.findViewById(R.id.mylistview);
mDrawerListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Expand All @@ -113,7 +112,7 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
getString(R.string.title_section3),
}));
mDrawerListView.setItemChecked(mCurrentSelectedPosition, true);
return mDrawerListView;
return v;
}

public boolean isDrawerOpen() {
Expand Down
17 changes: 7 additions & 10 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->
<com.charbgr.BlurNavigationDrawer.library.BlurDrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<com.charbgr.BlurNavigationDrawer.v4.BlurDrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:blurRadius="19"
app:closeDescription="@string/navigation_drawer_close"
app:downScaleFactor="8.0"
app:drawerUpImageId="@drawable/ic_drawer"
app:openDescription="@string/navigation_drawer_open"
app:closeDescription="@string/navigation_drawer_close"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<!-- As the main content view, the view below consumes the entire
Expand All @@ -21,8 +20,6 @@
android:layout_height="match_parent" />




<!-- android:layout_gravity="start" tells DrawerLayout ttreat
this as a sliding drawer on the left side for left-to-right
languages and on the right side for right-to-left languages.
Expand All @@ -38,4 +35,4 @@
android:layout_gravity="start"
tools:layout="@layout/fragment_navigation_drawer" />

</com.charbgr.BlurNavigationDrawer.library.BlurDrawerLayout>
</com.charbgr.BlurNavigationDrawer.v4.BlurDrawerLayout>
26 changes: 20 additions & 6 deletions app/src/main/res/layout/fragment_navigation_drawer.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#cccc"
tools:context=".NavigationDrawerFragment" />
android:orientation="vertical"
tools:context=".NavigationDrawerFragment"
android:background="#cccc">

<ListView
android:id="@+id/mylistview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp" />

<SeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:progress="20"
android:secondaryProgress="20" />
</LinearLayout>
14 changes: 7 additions & 7 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
compileSdkVersion 21
buildToolsVersion "21.0.2"

defaultConfig {
applicationId "com.charbgr.BlurNavigationDrawer.library"
applicationId "com.charbgr.BlurNavigationDrawer"
minSdkVersion 10
targetSdkVersion 19
versionCode 1
versionName "1.0"
targetSdkVersion 21
versionCode 2
versionName "1.1"
}
buildTypes {
release {
Expand All @@ -21,5 +21,5 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:20.0.0'
compile 'com.android.support:appcompat-v7:21.0.0'
}
15 changes: 8 additions & 7 deletions library/library.iml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugJava" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" />
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
<option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugTestSources" />
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
Expand All @@ -38,22 +39,22 @@
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/test/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
Expand All @@ -79,11 +80,11 @@
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 20 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="appcompat-v7-20.0.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-20.0.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-20.0.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-21.0.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-21.0.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-21.0.0" level="project" />
</component>
</module>

8 changes: 4 additions & 4 deletions library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.charbgr.BlurNavigationDrawer.library">
package="com.charbgr.BlurNavigationDrawer">

<application android:allowBackup="true"
android:label="@string/app_name"
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
>
android:label="@string/app_name">

</application>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.charbgr.BlurNavigationDrawer.library;
package com.charbgr.BlurNavigationDrawer;

import android.annotation.SuppressLint;
import android.content.Context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.charbgr.BlurNavigationDrawer.library;
package com.charbgr.BlurNavigationDrawer.v4;

import android.app.Activity;
import android.content.Context;
Expand All @@ -31,6 +31,8 @@
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.charbgr.BlurNavigationDrawer.Blur;

public class BlurActionBarDrawerToggle extends ActionBarDrawerToggle {

private Context context;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package com.charbgr.BlurNavigationDrawer.library;
package com.charbgr.BlurNavigationDrawer.v4;

import android.app.Activity;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.support.v4.widget.DrawerLayout;
import android.util.AttributeSet;

import com.charbgr.BlurNavigationDrawer.R;

/**
* Created by charbgr on 9/4/14.
*/
Expand All @@ -21,6 +22,8 @@ public BlurDrawerLayout(Context context) {
public BlurDrawerLayout(Context context, AttributeSet attrs) {
super(context, attrs);

System.out.println("hihii v2");

TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.BlurDrawerLayout, 0, 0);
try {

Expand Down Expand Up @@ -56,6 +59,8 @@ public void run() {
} finally {
ta.recycle();
}


}

public BlurDrawerLayout(Context context, AttributeSet attrs, int defStyle) {
Expand Down
Loading

0 comments on commit 882ec4e

Please sign in to comment.