Skip to content

Commit fe7d18c

Browse files
author
Sausure
committed
修复选中图片后图片会稍微上移再放大的BUG
1 parent 7e3e5cc commit fe7d18c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/src/main/java/com/github/obsessive/simplifyreader/ui/fragment/ImagesListFragment.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.github.obsessive.simplifyreader.ui.fragment;
1818

19+
import android.graphics.Rect;
1920
import android.os.Bundle;
2021
import android.support.v4.widget.SwipeRefreshLayout;
2122
import android.view.LayoutInflater;
@@ -276,8 +277,14 @@ public void onClick(View v) {
276277

277278
@Override
278279
public void onItemClick(PLAAdapterView<?> parent, View view, int position, long id) {
280+
Rect frame = new Rect();
281+
getActivity().getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);
282+
int statusBarHeight = frame.top;
283+
279284
int[] location = new int[2];
280285
view.getLocationOnScreen(location);
286+
location[1] += statusBarHeight;
287+
281288
int width = view.getWidth();
282289
int height = view.getHeight();
283290

0 commit comments

Comments
 (0)