Scroll to just added board, set as a plus icon and make the snackbar text color white

filtering
Floens 10 years ago
parent c23e4755e6
commit d95b9cfaca
  1. 7
      Clover/app/src/main/java/org/floens/chan/ui/controller/BoardEditController.java
  2. 17
      Clover/app/src/main/java/org/floens/chan/utils/AndroidUtils.java
  3. 4
      Clover/app/src/main/res/layout/controller_board_edit.xml

@ -191,7 +191,12 @@ public class BoardEditController extends Controller implements SwipeListener.Cal
boards.add(board);
adapter.notifyDataSetChanged();
Snackbar.make(view, string(R.string.board_add_success) + " " + board.key, Snackbar.LENGTH_LONG).show();
recyclerView.smoothScrollToPosition(boards.size());
Snackbar snackbar = Snackbar.make(view, string(R.string.board_add_success) + " " + board.key, Snackbar.LENGTH_LONG);
TextView snackbarText = (TextView) snackbar.getView().findViewById(R.id.snackbar_text);
snackbarText.setTextColor(0xffffffff);
snackbar.show();
return;
}

@ -249,7 +249,7 @@ public class AndroidUtils {
}
public static void setRoundItemBackground(View view) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (isLollipop()) {
setRoundItemBackgroundLollipop(view);
} else {
view.setBackgroundResource(R.drawable.item_background);
@ -286,4 +286,19 @@ public class AndroidUtils {
private static void setRoundItemBackgroundLollipop(View view) {
view.setBackground(getAttrDrawable(view.getContext(), android.R.attr.selectableItemBackgroundBorderless));
}
public static boolean isLollipop() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
}
public static void setElevation(View view, float elevation) {
if (isLollipop()) {
setElevationLollipop(view, elevation);
}
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private static void setElevationLollipop(View view, float elevation) {
view.setElevation(elevation);
}
}

@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingBottom="16dp"
android:paddingBottom="72dp"
android:scrollbarStyle="outsideOverlay"
android:scrollbars="vertical" />
@ -35,6 +35,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:layout_margin="16dp"
android:src="@drawable/ic_done_white_24dp" />
android:src="@drawable/ic_add_white_24dp" />
</android.support.design.widget.CoordinatorLayout>

Loading…
Cancel
Save