小编Set*_*san的帖子

Android Studio禁用换行

我在Android Studio上有这个奇怪的换行,我想要禁用因为它吓坏了我...

在此输入图像描述

android android-studio

38
推荐指数
6
解决办法
3万
查看次数

在 ConstraintLayout 中另一个 ImageView 之上的 ImageView

在此处输入图片说明

我正在使用 ConstraintLayout 来获取此结构。但是在最后一张图片中,加号图标 imageview 是半隐藏的。而且,在所有三个图像中,如果我设置图像,加号或十字符号的一部分会被隐藏。我尝试设置高度tranlationZ,但它并没有为我工作。

请帮我解决这个问题。

这是我的代码片段。

<!-- Constraint Layout -->


  <android.support.constraint.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:paddingEnd="@dimen/_16dp"
                android:paddingStart="@dimen/_16dp"
                android:paddingTop="@dimen/_16dp"
                tools:ignore="ContentDescription">

                <!-- Profile Pic -->

                <ImageView
                    android:id="@+id/img_profilePic"
                    android:layout_width="@dimen/_80dp"
                    android:layout_height="@dimen/_80dp"
                    android:background="@color/bg_light_gray"
                    app:layout_constraintStart_toStartOf="parent" />

                <ImageView
                    android:id="@+id/img_profilePic_delete"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/icon_cross"
                    app:layout_constraintBottom_toBottomOf="@+id/img_profilePic"
                    app:layout_constraintEnd_toEndOf="@+id/img_profilePic"
                    app:layout_constraintStart_toEndOf="@+id/img_profilePic"
                    app:layout_constraintTop_toBottomOf="@+id/img_profilePic" />

                <!-- Gallery Pic 1 -->

                <ImageView
                    android:id="@+id/img_galleryPic1"
                    android:layout_width="@dimen/_80dp"
                    android:layout_height="@dimen/_80dp"
                    android:background="@color/bg_light_gray"
                    app:layout_constraintEnd_toStartOf="@+id/img_galleryPic2"
                    app:layout_constraintStart_toEndOf="@+id/img_profilePic" />

                <ImageView
                    android:id="@+id/img_galleryPic1_add"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/icon_add_circle"

                    app:layout_constraintBottom_toBottomOf="@+id/img_galleryPic1"
                    app:layout_constraintEnd_toEndOf="@+id/img_galleryPic1"
                    app:layout_constraintStart_toEndOf="@+id/img_galleryPic1"
                    app:layout_constraintTop_toBottomOf="@+id/img_galleryPic1" />

                <ImageView
                    android:id="@+id/img_galleryPic1_delete"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/icon_cross"
                    android:visibility="gone"
                    app:layout_constraintBottom_toBottomOf="@+id/img_galleryPic1"
                    app:layout_constraintEnd_toEndOf="@+id/img_galleryPic1"
                    app:layout_constraintStart_toEndOf="@+id/img_galleryPic1"
                    app:layout_constraintTop_toBottomOf="@+id/img_galleryPic1" />

                <!-- Gallery …
Run Code Online (Sandbox Code Playgroud)

android android-constraintlayout

5
推荐指数
1
解决办法
2261
查看次数

Android ItemTouchHelper 部分滑动

当我们从最后滑动时,我可以显示红色背景和删除图标。我正在尝试实现部分滑动功能,在部分滑动时,滑动会在删除图标之前停止。我尝试遵循这些解决方案。但是,它对我不起作用。请指出我正确的方向。

public class PriorityItemTouchHelperCallback extends ItemTouchHelper.Callback {

private final ItemTouchHelperListener mAdapter;
private Context context;

public PriorityItemTouchHelperCallback(
        ItemTouchHelperListener adapter, Context context) {
    mAdapter = adapter;
    this.context = context;
}


@Override
public boolean isLongPressDragEnabled() {
    return true;
}

@Override
public boolean isItemViewSwipeEnabled() {
    return true;
}

@Override
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
    final int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
    final int swipeFlags = ItemTouchHelper.START;
    return makeMovementFlags(dragFlags, swipeFlags);
}

@Override
public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) { …
Run Code Online (Sandbox Code Playgroud)

java android android-recyclerview itemtouchhelper

4
推荐指数
1
解决办法
2247
查看次数

如何在git中恢复提交

我在一个个人项目中整天都在做一些事情,然后把它交给了一个分支机构.然后我意识到我将承诺掌握并创建一个新的分支推送到,并且git切换到该分支.之后我换回来但找不到我的提交.在创建分支之前有没有办法恢复提交?它恢复了我的很多工作.

git git-commit git-branch

0
推荐指数
1
解决办法
76
查看次数