Skip to content

Commit

Permalink
修改编辑全屏图片时,顶部增加间距
Browse files Browse the repository at this point in the history
  • Loading branch information
aaatttcccc committed Nov 19, 2021
1 parent 597d9c4 commit 63de960
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.ViewSwitcher;

import com.zhongjh.imageedit.core.ImageMode;
Expand Down Expand Up @@ -79,12 +76,6 @@ private void initViews() {
mLayoutOpSub = findViewById(R.id.layout_op_sub);

mImageViewCustom.addListener(() -> mColorGroup.clearCheck());

// 设置顶部状态栏间距
int statusBarHeight = StatusBarUtils.getStatusBarHeight(getApplicationContext());
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) mImageViewCustom.getLayoutParams();
layoutParams.setMargins(layoutParams.leftMargin, layoutParams.topMargin + statusBarHeight,
layoutParams.rightMargin, layoutParams.bottomMargin);
}

@Override
Expand Down
15 changes: 11 additions & 4 deletions imageedit/src/main/res/layout/image_edit_activity.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="#000"
android:layout_height="match_parent">

<View
android:id="@+id/toolbar"
android:background="#000"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize" />

<com.zhongjh.imageedit.view.ImageViewCustom
android:layout_below="@id/toolbar"
android:id="@+id/image_canvas"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:background="#000" />

<ViewSwitcher
android:id="@+id/vs_op"
Expand All @@ -22,4 +29,4 @@

</ViewSwitcher>

</FrameLayout>
</RelativeLayout>

0 comments on commit 63de960

Please sign in to comment.