imageview

Scaling then rotating a rectangle drawable

江枫思渺然 提交于 2019-12-24 09:51:03
问题 I would like to scale a rectangle drawable downwards, then rotate it so once it is clipped by the view it resembles a trapezoid with the left side slanted: The rotation is working fine: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item > <rotate android:fromDegrees="-19.5" android:toDegrees="-19.5" android:pivotX="0%" android:pivotY="0%" > <shape android:shape="rectangle" > <solid android:color="@android:color/black" /> <

Android - Repeat Scrolling Panoramic Photo Seamlessly Across Background

爷,独闯天下 提交于 2019-12-24 08:38:58
问题 I've been playing around with Java for sometime but I am fairly new to android development and still have lots to learn. I'm building an app for my toddler and would like to scroll a panoramic photo of a sky with clouds across the background of the home screen. I started with ImageView and TranslateAnimation which has the image scroll left to right without repeating. Also, it only shows as much of the image as will fit in the width of the screen. Am I going about this the wrong way? Please

How to set ImageView drawable Size based on Its parent view size?

Deadly 提交于 2019-12-24 08:34:44
问题 I have imageView inside a relative layout. And when i create the activity i run thread to grap bitmap from the internet and set the imageView. What i want is to resize the bitmap to scale based on relative view size while keeping the aspect ratio. The code for resizing the image is working but what i do is i get the relative view size by calling myRelativeView.getWidth() & myRelativeView.getHeight() and i feel that i should not do that because the docs say it could return 0. So what is the

Get constraint's id programmatically

放肆的年华 提交于 2019-12-24 08:30:04
问题 Given the following xml: <ImageView android:id="@+id/someTag" android:layout_width="10dp" android:layout_height="10dp" android:layout_marginBottom="12dp" android:layout_marginStart="8dp" android:tag="someTag" app:layout_constraintBottom_toTopOf="@+id/someID" app:layout_constraintStart_toEndOf="@+id/someID" I would like to know how to get the id of app:layout_constraintBottom_toTopOf (namely "someID") programatically. Many thanks! 回答1: That attribute value is held in the ImageView 's

Using Newer version of Glide Library(4.7.1) causing Binding error issue

倖福魔咒の 提交于 2019-12-24 07:39:12
问题 When I tried using a newer version of Glide Library gives me Binding Error in all the file. The moment I revert back to the older version, it works. The version I was using: **api 'com.github.bumptech.glide:glide:4.3.0'** Newer Version I updated: **dependencies { compile 'com.github.bumptech.glide:glide:4.7.1' }** Not sure about the cause of the issue. error: package com.xxx.xxx.databinding does not exist it is the same for all class org.gradle.api.tasks.TaskExecutionException: Execution

Pause Between Making ImageView Invisible and Visible Android

吃可爱长大的小学妹 提交于 2019-12-24 07:27:15
问题 I'm writing an Android app, and ran into a problem while I was coding the main part of the app. I need to have an ImageView disappear for a second or two, and then reappear when tapped. The tapping part works, I use XML to make it clickable and then call a method on click. The problem is in the method that I call. I need it to: Disappear Add one to the playerscore Re-display the playerscore Reappear with a delay of a few seconds My problem is that it does not noticeably disappear no matter

Pause Between Making ImageView Invisible and Visible Android

自闭症网瘾萝莉.ら 提交于 2019-12-24 07:27:07
问题 I'm writing an Android app, and ran into a problem while I was coding the main part of the app. I need to have an ImageView disappear for a second or two, and then reappear when tapped. The tapping part works, I use XML to make it clickable and then call a method on click. The problem is in the method that I call. I need it to: Disappear Add one to the playerscore Re-display the playerscore Reappear with a delay of a few seconds My problem is that it does not noticeably disappear no matter

How to drag and drop an image from a Recycler view and place it outside of it into another layout

喜你入骨 提交于 2019-12-24 06:43:01
问题 I have a horizontal Recylcer view which holds a list of items. Each item has a text view and image view to represent the item (e.g an image of a square and the text "Square" above the image). The recylcer view is inside of it's own relative layout positioned at the top of the screen. What I need to do is drag an image from the recycler view and drop it outside of it into another layout that is below this one. However, the image that is dragged from the recycler view must not be removed, but

Recycle ImageViews to avoid OutOfMemoryError

喜欢而已 提交于 2019-12-24 06:00:31
问题 In some phones (especially Samsungs), the application gives an error of OutOfMemory. I use a ViewFlipper with 4 ImageViews which they are shown in a tutorial. I have found no way to remedy the error or recycle imageviews. This is the method that manages the ViewFlipper: private void changeBackground(int position) { switch (position) { case 1: mViewFlipper.setDisplayedChild(1); mViewFlipper.setInAnimation(getActivity(), R.anim.anim_clockwise_onboarding); mViewFlipper.setOutAnimation

Recyclerview Images Misplacing and disappear while scrolling up/down

本小妞迷上赌 提交于 2019-12-24 05:48:21
问题 I'm retrieving Video thumbnails and displaying it in recycledview's imageview, problem that I'm facing with was Image's getting misplaced and disappeared while Scrolling Up/Down. When I'm using runnable class Recyclarview gets freezes. private static Bitmap retrieveVideoFrameFromVideo(String videoPath) { Bitmap bitmap = null; MediaMetadataRetriever mediaMetadataRetriever = null; try { mediaMetadataRetriever = new MediaMetadataRetriever(); if (Build.VERSION.SDK_INT >= 14) {