Skip to content

Commit

Permalink
Clean Start
Browse files Browse the repository at this point in the history
  • Loading branch information
aicaprio committed Dec 14, 2017
1 parent 92dbe77 commit 86219c3
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 35 deletions.
6 changes: 0 additions & 6 deletions app/build.gradle
Expand Up @@ -18,12 +18,6 @@ android {
}
}

repositories{
maven {
url "https://dl.bintray.com/aicaprio/android_libs"
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Expand Up @@ -9,7 +9,9 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity
android:name=".MainActivity"
android:theme="@style/AppTheme_FullScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

Expand Down
43 changes: 20 additions & 23 deletions app/src/main/java/org/aicaprio/app/MainActivity.java
Expand Up @@ -33,7 +33,7 @@ public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
showSample1();
// showSample2();
// showSample2();
}

private void showSample1() {
Expand All @@ -52,20 +52,19 @@ public void onClick(View v) {
}
});

mCurtainView
.setAutoScrollingListener(new ICurtainViewBase.AutoScrollingListener() {
@Override
public void onScrolling(int currValue, int currVelocity,
int startValue, int finalValue) {
}

@Override
public void onScrollFinished() {
boolean isOpened = mCurtainView.getCurtainStatus() == ICurtainViewBase.CurtainStatus.OPENED;
rbOpened.setChecked(isOpened);
rbClosed.setChecked(!isOpened);
}
});
mCurtainView.setAutoScrollingListener(new ICurtainViewBase.AutoScrollingListener() {
@Override
public void onScrolling(
int currValue, int currVelocity, int startValue, int finalValue) {
}

@Override
public void onScrollFinished() {
boolean isOpened = mCurtainView.getCurtainStatus() == ICurtainViewBase.CurtainStatus.OPENED;
rbOpened.setChecked(isOpened);
rbClosed.setChecked(!isOpened);
}
});

rgCGravity = (RadioGroup) findViewById(R.id.rgCurtainGravity);
rgReboundMode = (RadioGroup) findViewById(R.id.rgReboundMode);
Expand All @@ -90,8 +89,7 @@ private void setLayoutGravity(int layoutGravity) {
* parent is FrameLayout,we do like this when we change the
* CurtainGravity.
*/
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) mCurtainView
.getLayoutParams();
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) mCurtainView.getLayoutParams();
layoutParams.gravity = layoutGravity;
mCurtainView.setLayoutParams(layoutParams);
}
Expand Down Expand Up @@ -144,12 +142,12 @@ private void showSample2() {
final GridView gv1 = (GridView) findViewById(R.id.gv1);

final List<Map<String, Integer>> data = getData();
gv1.setAdapter(new SimpleAdapter(this, data, R.layout.item_numbers,
new String[] { TEXT_TAG }, new int[] { R.id.item_tvNum }));
gv1.setAdapter(new SimpleAdapter(this, data, R.layout.item_numbers, new String[]{TEXT_TAG},
new int[]{R.id.item_tvNum}));
gv1.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
public void onItemClick(
AdapterView<?> parent, View view, int position, long id) {
showToast(data.get(position).get(TEXT_TAG) + " clicked");
}
});
Expand All @@ -165,8 +163,7 @@ public void onClick(View v) {
curtainView.post(new Runnable() {
@Override
public void run() {
curtainView.setCurtainGravityAndFixedValue(null,
iv1.getHeight());
curtainView.setCurtainGravityAndFixedValue(null, iv1.getHeight());
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_sample.xml
Expand Up @@ -2,7 +2,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/bg_frame"
android:background="@mipmap/bg_frame2"
android:orientation="vertical">

<org.aicaprio.curtainview.CurtainView
Expand All @@ -17,7 +17,7 @@
curtainView:curtainGravity="left"
curtainView:curtainStatus="opened"
curtainView:reboundMode="half"
curtainView:scrollDuration="750">
curtainView:scrollDuration="500">

<RelativeLayout
android:layout_width="match_parent"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_sample2.xml
Expand Up @@ -2,7 +2,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/bg_frame">
android:background="@mipmap/bg_frame2">

<org.aicaprio.curtainview.CurtainView
xmlns:curtainView="http://schemas.android.com/apk/res-auto"
Expand All @@ -13,7 +13,7 @@
curtainView:curtainGravity="top"
curtainView:curtainStatus="closed"
curtainView:reboundMode="half"
curtainView:scrollDuration="1300">
curtainView:scrollDuration="750">

<RelativeLayout
android:layout_width="match_parent"
Expand Down
Binary file added app/src/main/res/mipmap-xhdpi/bg_frame2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion app/src/main/res/values/styles.xml
@@ -1,13 +1,20 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<style name="AppTheme" parent="Theme.AppCompat.Light">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme_FullScreen" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>

<style name="RadioButtonOff1">
<item name="android:layout_margin">5dp</item>
<item name="android:padding">10dp</item>
Expand Down
Binary file added imgs/ezgif-5-4fc93a6397.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/ezgif-5-f6189eb790.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 86219c3

Please sign in to comment.