gallery

Picture coming from camera or gallery?

浪尽此生 提交于 2019-11-29 02:26:08
问题 I have an intent chooser that allows me to pick image from gallery or camera like this: Intent galleryIntent = new Intent(Intent.ACTION_GET_CONTENT,null); galleryIntent.setType("image/*"); galleryIntent.addCategory(Intent.CATEGORY_OPENABLE); Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); Intent chooser = new Intent(Intent.ACTION_CHOOSER); chooser.putExtra(Intent.EXTRA_INTENT, galleryIntent); chooser.putExtra(Intent.EXTRA_TITLE, "title"); Intent[]

getting image name of image selected from gallery in android

强颜欢笑 提交于 2019-11-29 02:06:10
I have browsed image from gallery and set it to ImageView now I need to get image name of image that have been set in ImageView . I have attached my code below. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); Log.d("req","req"+requestCode); Log.d("res","res"+resultCode); if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK && null != data) { Uri selectedImage = data.getData(); String[] filePathColumn = { MediaStore.Images.Media.DATA }; Cursor cursor = getContentResolver().query

VueMusic-7更多-数据适配

荒凉一梦 提交于 2019-11-28 22:58:45
1.实例:路由传参 <template> <div class="more-list"> <div class="wrapper"> <h3>{{ this.$route.params.title }}</h3> <div class="info url log" v-for="(item,index) in moreListData" :key="index"> <div class="poster"> <img :src="item.pic_big" :alt="item.title"> </div> <div class="text-wrap"> <div class="title">{{ item.title }}</div> <div class="author">{{ item.artist_name }}</div> </div> </div> </div> </div> </template> <script> export default { name: "morelist", data() { return { moreListData: [] } }, mounted() { const moreListUrl = this.HOST + "/v1/restserver/ting?method=baidu.ting.billboard.billList

VueMusic-6首页-热门榜单

社会主义新天地 提交于 2019-11-28 22:53:21
1.实例 <template> <div class="mod-albums"> <div class="hd log url"> <h2>{{title}}</h2> <div>更多</div> </div> <div class="container"> <div class="gallery"> <div class="scroller"> <div class="card url" v-for="(item,index) in todayRecommend" :key="index"> <div class="album"> <img :src="item.pic_big" :alt="item.title"> <div class="name">{{item.title}}</div> </div> </div> </div> </div> </div> </div> </template> <script> export default { name: "todayRecommend", data() { return { todayRecommend: [] } }, props:{ title:{ type:String, default:"今天榜单" }, url:{ type:String, default:"/v1/restserver/ting?method

Android: Programmatically animate between images in Gallery widget

亡梦爱人 提交于 2019-11-28 20:53:16
Note: As of Jellybean the gallery widget is deprecated. A ViewPager should be used instead. I'd like to programmatically move between images in the Gallery widget, with animation. I can change the currently displaying image using the setSelection(int position) method, however that does not animate. Then there's setSelection(int position, bool animate) but the extra boolean on the end there doesn't appear to do anything. In the source of Gallery it appears that it can handle DPAD key-presses, so a work-around I thought of was to fake the key-presses. Eg. dispatchKeyEvent(new KeyEvent(KeyEvent

VueMusic-5首页-音乐榜单

心不动则不痛 提交于 2019-11-28 18:51:30
1.音乐榜单组件 <template> <div class="mod-albums"> <div class="hd log url"> <h2>新歌速递</h2> <div>更多</div> </div> <div class="container"> <div class="gallery"> <div class="scroller"> <div class="card url" v-for="(item,index) in newsMusic" :key="index"> <div class="album"> <img :src="item.pic_big" :alt="item.title"> <div class="name">{{item.title}}</div> <div class="author">{{ item.artist_name }}</div> </div> </div> </div> </div> </div> </div> </template> <script> export default { name: "newsMusic", data() { return { newsMusic: [] } }, mounted() { var url = this.HOST + "/v1/restserver/ting?method=baidu

Creating a custom Gallery - overriding onFling

我只是一个虾纸丫 提交于 2019-11-28 18:10:49
问题 So, I've followed this particular thread (How to stop scrolling in a Gallery Widget?) yet I am unable to get it to work properly. I've created a custom MyGallery class extending Gallery. I've added the code in the link above...am I supposed to add <com.example.mygallery to the XML file? If so, do I also add the import to the java file or is this not needed because of the XML file? I'm so very confused. I want to simply make the gallery move one image at a time per fling. XML file: <?xml

Changing image sizes proportionally using CSS?

若如初见. 提交于 2019-11-28 15:11:16
I have been trying for a couple of days now to configure my thumbnail gallery so all the images appear the same height and width. However when I change the Css code to, max-height: 150px; max-width: 200px; width: 120px; height: 120px; I get images that are all the same size but the aspect ratio is stretched ruining the images. is there not a way to resize the image container and not the image instead? allowing me to keep the aspect ratio. but resize the image still. (I dont mind if i cut off some of the image.) Thanks in advance! this is a known problem with CSS resizing, unless all images

How to distinguish whether the image is coming from gallery or camera in android?

[亡魂溺海] 提交于 2019-11-28 14:42:33
I am making an app in which i can pick an image from gallery or i can take image from camera and i am moving to next activity with the selected image.There I want to distinguish whether the image is coming from gallery or camera.I am not getting any idea how to do it.I am providing my code.Please help me how to do this. My first activity is import java.io.ByteArrayOutputStream; import android.app.Activity; import android.content.Intent; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.Color; import android.net.Uri; import android.os.Bundle; import android

How to avoid spacing in the start and end of Gallery

空扰寡人 提交于 2019-11-28 13:50:46
I don't want a circular gallery, but instead I don't want to show the free space in the left and right end of the gallery? Is there any possible way I can achieve this? I will suggest you to try HorizontalListView . Its not that good as other android components but proves to be worth in most of the cases Horizontal ListView implementation has the following features: Subclass AdapterView so I can make use of adapters Fast – make use of recycled views when possible Items are clickable – (accepts AdapterView.OnItemClickListener) Scrollable No center-locking 来源: https://stackoverflow.com/questions