commonsware-cwac

Accessing a Loader created in one fragment from another fragment

£可爱£侵袭症+ 提交于 2019-12-04 15:44:34
I have an app with a fairly standard fragment layout. An expandable listview fragment on the left and a panel on the right that is used for different things depending on what the user chooses to do with the list on the left (displaying data, adding new data, etc). I'm using the LoaderManager (first time using loaders) with CommonWare's loaderex library as I have no need or desire to create a Content Provider for my database just so I can use a standard CursorLoader. This setup works great for displaying my list. The issue I am having is when I use the second fragment to add data to the

How to share an image file to WhatsApp and Viber on Android 7.1.1?

不羁的心 提交于 2019-12-04 13:20:12
Background Similar to issues I've recently had with sharing/opening APK files ( here , here and here ) , I now have an issue of sending an image file (in assets, res/raw or even from a URL) to specific apps: WhatsApp and Viber. I need to be able to share an image file to all apps, especially popular ones such as WhatsApp and Viber. The problem Both WhatsApp and Viber have issues when I try to share the image files on Andorid 7.1.1 . On other apps, and on previous versions of Android, it worked fine. They either show a black screen (no image) or close themselves, on all of the test I've tried.

Is there any way to listen for when the camera has loaded in? cwac-camera

半腔热情 提交于 2019-12-04 01:54:47
问题 I've got my CWAC Camera fragment setup, and everything is working nicely. There's a few customizations I'd like to do. I'd like to show a ProgressBar as the camera fragment is loading into it's host Activity/Fragment After a user has taken a picture, I want to show a ProgressBar again overlay on the picture taking button, so they understand they can't immediately take a picture until the camera is ready again From looking into the documentation for CWAC Camera, I haven't found anything that

How to automatically re-query with LoaderManager

风格不统一 提交于 2019-12-02 16:35:17
问题 I have an app that shows data from a SQLite DB and the data changes constantly, so obviously, I thought I should use a LoaderManager to show the data. do I read a bit about using the LoaderManager with SQLite and saw Alex Lokwood's answer about implementing the CursorLoader and using it, and I saw the this answer about using a CursorLoader directly to an SQLite DB instead of a ContentProvider and started using commonsware's Loaderex. I created this class for showing the data in a ListView:

sendWakefulWork not always called with cwac-wakeful-1.1.0

落爺英雄遲暮 提交于 2019-12-02 03:48:03
问题 I've got a problem for a long time now and I discovered cwac-wakeful, which could solve all my problems. I thought... :'( In short, for solving the problem, I've implemented a most simple app, which schedules alarm every 60 seconds and logs everytime. Here's my code : MainActivity : package com.par.hasard.mysimpleapplication; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class MainActivity extends

Is there any way to listen for when the camera has loaded in? cwac-camera

試著忘記壹切 提交于 2019-12-01 10:50:12
I've got my CWAC Camera fragment setup, and everything is working nicely. There's a few customizations I'd like to do. I'd like to show a ProgressBar as the camera fragment is loading into it's host Activity/Fragment After a user has taken a picture, I want to show a ProgressBar again overlay on the picture taking button, so they understand they can't immediately take a picture until the camera is ready again From looking into the documentation for CWAC Camera, I haven't found anything that supports this sort of callback. Is this sort of thing even possible to listen for? If so, does the

Camera preview quality in Android is poor

守給你的承諾、 提交于 2019-12-01 06:52:49
I am making a Camera app in Android and have used the following function to get the preview size: private Size getOptimalPreviewSize(List<Size> sizes, int w, int h) { final double ASPECT_TOLERANCE = 0.1; double targetRatio = (double) w / h; if (sizes == null) return null; Size optimalSize = null; double minDiff = Double.MAX_VALUE; int targetHeight = h; // Try to find an size match aspect ratio and size for (Size size : sizes) { double ratio = (double) size.width / size.height; if (Math.abs(ratio - targetRatio) > ASPECT_TOLERANCE) continue; if (Math.abs(size.height - targetHeight) < minDiff) {

Camera preview quality in Android is poor

丶灬走出姿态 提交于 2019-12-01 03:42:45
问题 I am making a Camera app in Android and have used the following function to get the preview size: private Size getOptimalPreviewSize(List<Size> sizes, int w, int h) { final double ASPECT_TOLERANCE = 0.1; double targetRatio = (double) w / h; if (sizes == null) return null; Size optimalSize = null; double minDiff = Double.MAX_VALUE; int targetHeight = h; // Try to find an size match aspect ratio and size for (Size size : sizes) { double ratio = (double) size.width / size.height; if (Math.abs

Remove view from MergeAdapter

老子叫甜甜 提交于 2019-11-30 22:34:33
Is it possible to remove view or adapter from MergeAdapter somehow? I'd try to extend it and remove the view from pieces but it's private . Or maybe there's an alternative solution to show/hide view in this adapter? I tried to set its layout_height to zero and visibility to View.GONE , but it still shows the empty list item. Thanks in advance. Nirav Sanghvi To remove a view or an adapter from MergeAdapter use the following methods: setActive() on your mergeAdapter Instance. For Example : To remove a Textview (mytextView) from a MergeAdapter (merAdapter) use: merAdapter.setActive(mytextViiew

Remove view from MergeAdapter

元气小坏坏 提交于 2019-11-30 17:29:20
问题 Is it possible to remove view or adapter from MergeAdapter somehow? I'd try to extend it and remove the view from pieces but it's private . Or maybe there's an alternative solution to show/hide view in this adapter? I tried to set its layout_height to zero and visibility to View.GONE , but it still shows the empty list item. Thanks in advance. 回答1: To remove a view or an adapter from MergeAdapter use the following methods: setActive() on your mergeAdapter Instance. For Example : To remove a