This repository has been archived by the owner on Feb 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from rey5137/dev
Add sb_text, sb_actionText, sb_duration attribute to SnackBar class.
- Loading branch information
Showing
13 changed files
with
161 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
app/src/main/java/com/rey/material/demo/SpinnersFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.rey.material.demo; | ||
|
||
import android.annotation.TargetApi; | ||
import android.graphics.drawable.Drawable; | ||
import android.os.Build; | ||
import android.os.Bundle; | ||
import android.support.v4.app.Fragment; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.ArrayAdapter; | ||
|
||
import com.rey.material.widget.FloatingActionButton; | ||
import com.rey.material.widget.Spinner; | ||
|
||
public class SpinnersFragment extends Fragment{ | ||
|
||
|
||
public static SpinnersFragment newInstance(){ | ||
SpinnersFragment fragment = new SpinnersFragment(); | ||
|
||
return fragment; | ||
} | ||
|
||
private Drawable[] mDrawables = new Drawable[2]; | ||
private int index = 0; | ||
|
||
@TargetApi(Build.VERSION_CODES.HONEYCOMB) | ||
@Override | ||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | ||
View v = inflater.inflate(R.layout.fragment_spinner, container, false); | ||
|
||
Spinner spn_label = (Spinner)v.findViewById(R.id.spinner_label); | ||
Spinner spn_no_arrow = (Spinner)v.findViewById(R.id.spinner_no_arrow); | ||
ArrayAdapter<String> adapter = new ArrayAdapter<>(getActivity(), R.layout.row_spn, new String[]{"Item 1", "Item 2", "Item 333333333333333"}); | ||
adapter.setDropDownViewResource(R.layout.row_spn_dropdown); | ||
spn_label.setAdapter(adapter); | ||
spn_no_arrow.setAdapter(adapter); | ||
|
||
return v; | ||
} | ||
|
||
@Override | ||
public void onPause() { | ||
super.onPause(); | ||
} | ||
|
||
@Override | ||
public void onResume() { | ||
super.onResume(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:fillViewport="true" | ||
android:scrollbarStyle="outsideOverlay"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
android:gravity="center" | ||
android:padding="8dp"> | ||
|
||
<com.rey.material.widget.Spinner | ||
style="@style/Material.Widget.Spinner.Light" | ||
android:id="@+id/spinner_label" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:minWidth="128dp" | ||
app:ripple="@style/FlatWaveButtonRippleStyle" | ||
app:delayClick="false" | ||
app:spn_labelEnable="true" | ||
app:spn_label="Spinner with arrow" | ||
app:spn_arrowSwitchMode="true" | ||
app:spn_arrowAnimDuration="@android:integer/config_shortAnimTime" | ||
app:spn_arrowInterpolator="@android:anim/decelerate_interpolator"/> | ||
|
||
<com.rey.material.widget.Spinner | ||
style="@style/Material.Widget.Spinner.Light" | ||
android:id="@+id/spinner_no_arrow" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:minWidth="128dp" | ||
android:layout_marginTop="16dp" | ||
app:ripple="@style/FlatWaveButtonRippleStyle" | ||
app:delayClick="false" | ||
app:spn_labelEnable="true" | ||
app:spn_label="Spinner without arrow" | ||
app:spn_arrowSize="0dp" | ||
app:spn_popupItemAnimation="@anim/abc_fade_in"/> | ||
|
||
|
||
</LinearLayout> | ||
|
||
|
||
</ScrollView> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<com.rey.material.widget.TextView xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:id="@+id/row_spn_tv" | ||
android:layout_width="match_parent" | ||
android:layout_height="48dp" | ||
android:textSize="16sp" | ||
android:gravity="center_vertical" | ||
android:textColor="#FF000000" | ||
android:paddingLeft="16dp" | ||
android:paddingRight="16dp" | ||
app:ripple="@style/MenuItemRippleStyle" | ||
app:delayClick="true"/> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters