58 58
59
            @Override
60
            public boolean onDoubleTap(MotionEvent motionEvent) {
61
                if (photoView.getScaleType() == ImageView.ScaleType.FIT_CENTER) {
62
                    photoView.setScaleType(ImageView.ScaleType.FIT_START);
63
                }
64
                Log.d(TAG, "onDoubleTap: " + photoView.getScaleType());
65
                return false;
66
            }
59
    @Override
60
    public void onPause() {
61
        super.onPause();
62
    }
67 63
68
            @Override
69
            public boolean onDoubleTapEvent(MotionEvent motionEvent) {
70 64
71
                return false;
72
            }
73
        });
65
    private void initView(View rootView, String url) {
66
        photoView = rootView.findViewById(R.id.photoView);
67
//        ImageDisplayUtils.dispalyImg(getContext(), url, photoView);
68
69
70
        Picasso.with(getContext())
71
                .load(url)
72
                .placeholder(R.drawable.icon_face2_0)
73
                .error(R.drawable.icon_face2_0)
74
                .into(photoView);
75
//        photoView.setOnDoubleTapListener(new GestureDetector.OnDoubleTapListener() {
76
//            @Override
77
//            public boolean onSingleTapConfirmed(MotionEvent motionEvent) {
78
//                return false;
79
//            }
80
//
81
//            @Override
82
//            public boolean onDoubleTap(MotionEvent motionEvent) {
83
//                if (photoView.getScaleType() == ImageView.ScaleType.FIT_CENTER) {
84
//                    photoView.setScaleType(ImageView.ScaleType.FIT_START);
85
//                }
86
//                Log.d(TAG, "onDoubleTap: " + photoView.getScaleType());
87
//                return false;
88
//            }
89
//
90
//            @Override
91
//            public boolean onDoubleTapEvent(MotionEvent motionEvent) {
92
//
93
//                return false;
94
//            }
95
//        });
74 96
    }
75 97
}

+ 2 - 2
app/src/main/res/layout/fragment_chat_content_pictures.xml

@ -4,7 +4,7 @@
4 4
    xmlns:tools="http://schemas.android.com/tools"
5 5
    android:layout_width="match_parent"
6 6
    android:layout_height="match_parent"
7
    android:background="#990545">
7
    android:background="#424242">
8 8
9 9
    <android.support.v4.view.ViewPager
10 10
        android:id="@+id/photoPager"
@ -14,7 +14,7 @@
14 14
        app:layout_constraintLeft_toLeftOf="parent"
15 15
        app:layout_constraintRight_toRightOf="parent"
16 16
        app:layout_constraintTop_toBottomOf="@+id/navBar"
17
        android:background="#66bd00"></android.support.v4.view.ViewPager>
17
        tools:background="#66bd00"></android.support.v4.view.ViewPager>
18 18
19 19
    <!--<include layout="@layout/fragment_chat_content_common" />-->
20 20
    <android.support.constraint.ConstraintLayout

+ 22 - 5
app/src/main/res/layout/fragment_chat_photo.xml

@ -1,13 +1,30 @@
1 1
<?xml version="1.0" encoding="utf-8"?>
2
<android.support.constraint.ConstraintLayout
3
    xmlns:android="http://schemas.android.com/apk/res/android"
2
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
4 3
    xmlns:app="http://schemas.android.com/apk/res-auto"
5 4
    xmlns:tools="http://schemas.android.com/tools"
6 5
    android:layout_width="match_parent"
7 6
    android:layout_height="match_parent">
8 7
9 8
    <com.github.chrisbanes.photoview.PhotoView
10
        android:id="@+id/photoView"
11
        android:layout_width="match_parent"
12
        android:layout_height="match_parent" />
9
    android:id="@+id/photoView"
10
    android:layout_width="match_parent"
11
    android:layout_height="wrap_content"
12
    android:adjustViewBounds="true"
13
    android:scaleType="fitXY"
14
    app:layout_constraintBottom_toBottomOf="parent"
15
    app:layout_constraintLeft_toLeftOf="parent"
16
    app:layout_constraintRight_toRightOf="parent"
17
    app:layout_constraintTop_toTopOf="parent" />
18
19
    <!--<ImageView-->
20
        <!--android:id="@+id/photoView"-->
21
        <!--android:layout_width="match_parent"-->
22
        <!--android:layout_height="wrap_content"-->
23
        <!--android:scaleType="fitXY"-->
24
        <!--android:adjustViewBounds="true"-->
25
        <!--android:src="@drawable/bg_guide_two"-->
26
        <!--app:layout_constraintBottom_toBottomOf="parent"-->
27
        <!--app:layout_constraintLeft_toLeftOf="parent"-->
28
        <!--app:layout_constraintRight_toRightOf="parent"-->
29
        <!--app:layout_constraintTop_toTopOf="parent" />-->
13 30
</android.support.constraint.ConstraintLayout>

Shoshana Barnes - Gogs: Go Git Service
broken-key-repair6143 (Shoshana Barnes)

Obserwujący