Skip to content

Commit b5e623b

Browse files
committed
remove circle button dependency and use android design fab
1 parent ba8f0b1 commit b5e623b

File tree

5 files changed

+19
-21
lines changed

5 files changed

+19
-21
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ org.gradle.jvmargs=-Xmx1536m
1414
# When configured, Gradle will run in incubating parallel mode.
1515
# This option should only be used with decoupled projects. More details, visit
1616
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17-
# org.gradle.parallel=true
17+
# org.gradle.parallel=true

storagechooser/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ dependencies {
3333
})
3434
implementation 'com.android.support:appcompat-v7:27.1.1'
3535
implementation 'com.android.support:design:27.1.1'
36-
implementation 'com.github.markushi:circlebutton:1.1'
3736
testImplementation 'junit:junit:4.12'
3837
}
3938

storagechooser/src/main/java/com/codekidlabs/storagechooser/fragments/SecondaryChooserFragment.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
import android.os.Handler;
1414
import android.support.annotation.NonNull;
1515
import android.support.annotation.Nullable;
16+
import android.support.design.widget.FloatingActionButton;
1617
import android.support.v4.content.ContextCompat;
1718
import android.util.Log;
1819
import android.util.TypedValue;
20+
import android.view.ContextThemeWrapper;
1921
import android.view.LayoutInflater;
2022
import android.view.View;
2123
import android.view.ViewGroup;
@@ -50,7 +52,6 @@
5052
import java.util.Comparator;
5153
import java.util.List;
5254

53-
import at.markushi.ui.CircleButton;
5455

5556
import static com.codekidlabs.storagechooser.StorageChooser.Theme;
5657

@@ -73,7 +74,7 @@ public class SecondaryChooserFragment extends android.app.DialogFragment {
7374
private Button mCreateButton;
7475
private ImageView mNewFolderImageView;
7576
private EditText mFolderNameEditText;
76-
private CircleButton mMultipleOnSelectButton;
77+
private FloatingActionButton mMultipleOnSelectButton;
7778
private RelativeLayout mNewFolderView;
7879
private ProgressBar mFilesProgress;
7980
private String mBundlePath;
@@ -341,9 +342,12 @@ private View getLayout(LayoutInflater inflater, ViewGroup container) {
341342
mContent = mConfig.getContent();
342343
}
343344

345+
final Context contextThemeWrapper = new ContextThemeWrapper(getActivity(), R.style.DialogTheme);
346+
LayoutInflater li = inflater.cloneInContext(contextThemeWrapper);
347+
344348
mContext = getActivity().getApplicationContext();
345349
mResourceUtil = new ResourceUtil(mContext);
346-
mLayout = inflater.inflate(R.layout.custom_storage_list, container, false);
350+
mLayout = li.inflate(R.layout.custom_storage_list, container, false);
347351

348352
initListView(mContext, mLayout, mConfig.isShowMemoryBar());
349353

@@ -406,7 +410,7 @@ private void updateUI() {
406410
mNewFolderImageView.setImageTintList(ColorStateList.valueOf(scheme[Theme.SEC_ADDRESS_TINT_INDEX]));
407411
mBackButton.setImageTintList(ColorStateList.valueOf(scheme[Theme.SEC_ADDRESS_TINT_INDEX]));
408412
}
409-
mMultipleOnSelectButton.setColor(scheme[Theme.SEC_DONE_FAB_INDEX]);
413+
mMultipleOnSelectButton.setBackgroundTintList(ColorStateList.valueOf(scheme[Theme.SEC_DONE_FAB_INDEX]));
410414
mLayout.findViewById(R.id.custom_path_header).setBackgroundColor(scheme[Theme.SEC_ADDRESS_BAR_BG]);
411415

412416
// ----

storagechooser/src/main/res/layout-v21/custom_storage_list.xml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
android:layout_centerInParent="true"
9999
android:layout_width="150dp"
100100
android:layout_height="wrap_content"
101-
android:visibility="visible"
101+
android:visibility="invisible"
102102
/>
103103

104104

@@ -152,18 +152,16 @@
152152
android:layout_below="@id/custom_path_header"
153153
android:background="@color/inactiveGradientColor" />
154154

155-
<at.markushi.ui.CircleButton
155+
<android.support.design.widget.FloatingActionButton
156156
android:id="@+id/multiple_selection_done_fab"
157-
android:layout_width="72dip"
158-
android:layout_height="72dip"
157+
app:fabSize="normal"
158+
android:layout_width="wrap_content"
159+
android:layout_height="wrap_content"
159160
android:layout_alignParentBottom="true"
160161
android:layout_alignParentEnd="true"
161162
android:layout_margin="16dp"
162-
android:drawableTop="@drawable/ic_chevron_left_white_24dp"
163-
android:src="@drawable/ic_check_white_24dp"
164-
android:visibility="invisible"
165-
app:cb_color="@color/colorAccent"
166-
app:cb_pressedRingWidth="8dip" />
163+
app:srcCompat="@drawable/ic_check_white_24dp"
164+
android:visibility="invisible" />
167165

168166
</RelativeLayout>
169167

storagechooser/src/main/res/layout/custom_storage_list.xml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
android:layout_width="wrap_content"
9898
android:layout_height="wrap_content"
9999
android:layout_below="@+id/custom_path_header"
100-
android:visibility="visible"
100+
android:visibility="invisible"
101101
/>
102102

103103

@@ -153,19 +153,16 @@
153153
android:layout_below="@id/custom_path_header"
154154
android:background="@color/inactiveGradientColor" />
155155

156-
<at.markushi.ui.CircleButton
156+
<android.support.design.widget.FloatingActionButton
157157
android:id="@+id/multiple_selection_done_fab"
158158
android:layout_width="72dip"
159159
android:layout_height="72dip"
160160
android:layout_alignParentBottom="true"
161161
android:layout_alignParentEnd="true"
162162
android:layout_alignParentRight="true"
163163
android:layout_margin="16dp"
164-
android:drawableTop="@drawable/ic_chevron_left_white_24dp"
165164
android:src="@drawable/ic_check_white_24dp"
166-
android:visibility="invisible"
167-
app:cb_color="@color/colorAccent"
168-
app:cb_pressedRingWidth="8dip" />
165+
android:visibility="invisible" />
169166

170167
</RelativeLayout>
171168

0 commit comments

Comments
 (0)