-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build | ||
/captures |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 23 | ||
buildToolsVersion "23.0.2" | ||
|
||
defaultConfig { | ||
applicationId "com.daprlabs.swipedeck" | ||
minSdkVersion 14 | ||
targetSdkVersion 23 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
compile 'junit:junit:4.12' | ||
compile 'com.android.support:appcompat-v7:23.1.1' | ||
compile 'com.android.support:design:23.1.1' | ||
compile 'com.android.support:cardview-v7:23.1.1' | ||
compile project(':cardstack') | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in C:\Users\aaron\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.daprlabs.swipedeck; | ||
|
||
import android.app.Application; | ||
import android.test.ApplicationTestCase; | ||
|
||
/** | ||
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> | ||
*/ | ||
public class ApplicationTest extends ApplicationTestCase<Application> { | ||
public ApplicationTest() { | ||
super(Application.class); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.daprlabs.swipedeck"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity | ||
android:name=".SwipeDeckActivity" | ||
android:label="@string/app_name" | ||
android:theme="@style/AppTheme.NoActionBar"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
package com.daprlabs.swipedeck; | ||
|
||
import android.content.Context; | ||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.LayoutInflater; | ||
import android.view.Menu; | ||
import android.view.MenuItem; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.BaseAdapter; | ||
|
||
import com.daprlabs.cardstack.SwipeDeck; | ||
import com.daprlabs.cardstack.SwipeFrameLayout; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class SwipeDeckActivity extends AppCompatActivity { | ||
|
||
private SwipeDeck container; | ||
private SwipeFrameLayout x; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_swipe_deck); | ||
x = new SwipeFrameLayout(this); | ||
|
||
container = (SwipeDeck) findViewById(R.id.swipe_deck); | ||
|
||
ArrayList<String> testData = new ArrayList<>(); | ||
testData.add("1"); | ||
testData.add("2"); | ||
testData.add("3"); | ||
testData.add("4"); | ||
testData.add("5"); | ||
testData.add("1"); | ||
testData.add("2"); | ||
testData.add("3"); | ||
testData.add("4"); | ||
testData.add("5"); | ||
testData.add("1"); | ||
testData.add("2"); | ||
testData.add("3"); | ||
testData.add("4"); | ||
testData.add("5"); | ||
testData.add("1"); | ||
testData.add("2"); | ||
testData.add("3"); | ||
testData.add("4"); | ||
testData.add("5"); | ||
testData.add("1"); | ||
testData.add("2"); | ||
testData.add("3"); | ||
testData.add("4"); | ||
testData.add("5"); | ||
|
||
SwipeDeckAdapter adapter = new SwipeDeckAdapter(testData, this); | ||
container.setAdapter(adapter); | ||
|
||
} | ||
|
||
@Override | ||
public boolean onCreateOptionsMenu(Menu menu) { | ||
// Inflate the menu; this adds items to the action bar if it is present. | ||
getMenuInflater().inflate(R.menu.menu_swipe_deck, menu); | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean onOptionsItemSelected(MenuItem item) { | ||
// Handle action bar item clicks here. The action bar will | ||
// automatically handle clicks on the Home/Up button, so long | ||
// as you specify a parent activity in AndroidManifest.xml. | ||
int id = item.getItemId(); | ||
|
||
//noinspection SimplifiableIfStatement | ||
if (id == R.id.action_settings) { | ||
return true; | ||
} | ||
|
||
return super.onOptionsItemSelected(item); | ||
} | ||
|
||
|
||
public class SwipeDeckAdapter extends BaseAdapter { | ||
|
||
private List<String> data; | ||
private Context context; | ||
|
||
public SwipeDeckAdapter(List<String> data, Context context) { | ||
this.data = data; | ||
this.context = context; | ||
} | ||
|
||
@Override | ||
public int getCount() { | ||
return data.size(); | ||
} | ||
|
||
@Override | ||
public Object getItem(int position) { | ||
return data.get(position); | ||
} | ||
|
||
@Override | ||
public long getItemId(int position) { | ||
return position; | ||
} | ||
|
||
@Override | ||
public View getView(int position, View convertView, ViewGroup parent) { | ||
|
||
View v = convertView; | ||
if(v == null){ | ||
LayoutInflater inflater = getLayoutInflater(); | ||
// normally use a viewholder | ||
v = inflater.inflate(R.layout.test_card2, parent, false); | ||
} | ||
//((TextView) v.findViewById(R.id.textView2)).setText(data.get(position)); | ||
|
||
return v; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item > | ||
<shape | ||
android:shape="rectangle"> | ||
<solid android:color="@android:color/darker_gray" /> | ||
<corners android:radius="5dp"/> | ||
</shape> | ||
</item> | ||
<item android:right="1dp" android:left="1dp" android:bottom="2dp"> | ||
<shape | ||
android:shape="rectangle"> | ||
<solid android:color="@android:color/white"/> | ||
<corners android:radius="5dp"/> | ||
</shape> | ||
</item> | ||
</layer-list> | ||
<!--<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:bottom="18dp"> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="#FFFFFF" /> | ||
<corners android:radius="7dp" /> | ||
</shape> | ||
</item> | ||
</layer-list>--> | ||
|
||
|
||
|
||
|
||
<!-- <!– bottom sheet –> | ||
<item android:bottom="6dp"> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="#aaa" /> | ||
<corners android:radius="7dp" /> | ||
</shape> | ||
</item> | ||
<!– middle sheet –> | ||
<item android:bottom="12dp"> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="#ccc" /> | ||
<corners android:radius="7dp" /> | ||
</shape> | ||
</item>--> | ||
<!-- White Top sheet --> |