commonsware-cwac

CWAC Camera: why my SimpleCameraHost saveImage is so slow, am I doing something wrong?

末鹿安然 提交于 2019-12-25 03:55:41
问题 How to optimize this peace of code? It takes about a minute on saveImage method. class ObrolSimpleHost extends SimpleCameraHost { private final String[] SCAN_TYPES = {"image/webp"}; private Context context = null; public ObrolSimpleHost(Context _ctxt) { super(_ctxt); this.context = getActivity(); } @Override public void saveImage(PictureTransaction xact, Bitmap bitmap) { File photo = getPhotoPath(); if (photo.exists()) { photo.delete(); } try { FileOutputStream fos = new FileOutputStream

How to show All list items in child ListView-using cwac-merge-1.0.4 jar

╄→尐↘猪︶ㄣ 提交于 2019-12-24 02:43:45
问题 I am using two ListView in same screen,Because of using two Listviews likely Parent ListView and Child ListView ,that Child ListView Adapter class doesn't show all List Values in Child ListView.It showed only 0 th(first) position in Child ListView,for this above issue I have used the answer code from this Android list view inside a scroll view link.now I can see all list values in my Child ListView but It is not showing all my List values in same time which I had grabbed from Web service call

Getting SQLiteCursorLoader to observe data changes

怎甘沉沦 提交于 2019-12-18 03:49:07
问题 I'm trying to implement a DataListFragment with an adapter that uses a Loader from Commonsware. This Loader uses a SQLiteDatabase directly and doesn't require the use of ContentProviders. The android reference states about Loaders: "While Loaders are active they should monitor the source of their data and deliver new results when the contents change." Under my SQLiteCursor implementation (below), this does not happen. OnLoadFinished() gets called once and that's it. Presumably, one could

Add footer to Android TouchListView

╄→尐↘猪︶ㄣ 提交于 2019-12-14 02:17:24
问题 Hi I'm using the TouchListView control from here: https://github.com/commonsguy/cwac-touchlist and I've added some buttons to add to the list in the footer: mFooter = getLayoutInflater().inflate(R.layout.edit_homepage_footer_layout, null); mListView = (TouchListView) findViewById(R.id.sectionList); mListView.addFooterView(mFooter); It all seems to be working fine until I drag an item in the list, at which point the footer collapses (to the height of one list item I think) obscuring the

Endless adapter always running to download data in background

微笑、不失礼 提交于 2019-12-13 21:04:23
问题 I have customized the code of EndlessAdapter in my app but one mistake done by me as this Endless Adapter always download data in the background instead it should download the same after user scroll downs the list and I unable to find the same mistake in our project. Due to this mistake my app sometimes returns OutOfMemoryException which is not acceptable. Please suggest me any solution regarding the same. Code: * MyEndlessAdapter: * class DemoAdapterCat extends EndlessAdapter { private

Drag and Drop with cwac-touchlist

血红的双手。 提交于 2019-12-13 07:15:42
问题 I have two questions. 1. How to make app remember new order in ListView what I made with drag and drop. Like now I can reorder items but every time I open app, I have to reorder items again. 2. My app should open different webpage from each item. But when I reorder items then web links doesn't reorder. They stick on same. Like example: I have items Google and Yahoo! so links are "http://google.com" and "http://yahoo.com". Then I reorder item: Google was top but I drag Yahoo to top. After that

Dynamically Adding and Removing tabs using ArrayPagerAdapter

时光毁灭记忆、已成空白 提交于 2019-12-13 05:06:54
问题 This is a continuation from the question I 1st asked here, Creating a new ArrayPagerAdapter with variety of Fragments. You were dead on about me using the wrong ArrayAdapter I just needed to use the one that has v4 support. I have posted the code for it below. One of the next blocks i'm getting stuck on right now is creating the PageDescriptor objects in the ArrayList passed into SimplePageAdapter. I've tried copying and pasting the SimplePageDescriptor class used in the Demo into my code but

Implementing a WakefulIntentService in a multiple activity aplication

狂风中的少年 提交于 2019-12-12 05:30:00
问题 I have a application which needs to poll data at frequent intervals. I had an App Service logic with TimerTask implementation but then I moved to WakefulIntentService by @Commonsware. Now my problem is that I have multiple activity screens that respond to a broadcast intent sent out by the Service. How do I ensure that the call to scheduleAlarms will be called only once (or is it not necessary that I bother about this?). The actual problem is that the code to scheduleAlarms is placed on a

implement camaraview of CWAC-camera2 in my application

◇◆丶佛笑我妖孽 提交于 2019-12-12 03:38:51
问题 As I can implement camaraview of CWAC-camera2 in my application that has another interface? To implement the cameraview and obtain the resulting bitmap photo 回答1: what I want is to use the camera and its methods in my interface If by "my interface", you mean your user interface (UI), then that is not supported. The code is open source, and you are welcome to use it however you want, but I am not supporting alternative UIs at this time, or any time soon. 来源: https://stackoverflow.com/questions

MergeAdapter with Gridview

家住魔仙堡 提交于 2019-12-12 03:16:12
问题 Libraries: https://github.com/commonsguy/cwac-merge https://github.com/maurycyw/StaggeredGridView https://github.com/chrisbanes/Android-PullToRefresh I'd like to add a gridview adapter with MergeAdapter. 1st way, If you set adapter: plv = (PullToRefreshListView) LayoutInflater.from(context).inflate( R.layout.layout_listview_in_viewpager, container, false); adapter = new MergeAdapter(); sadapter = new StaggeredAdapter(BaseSampleActivity.this, R.id.imageView1, urls); adapter.addAdapter(sadapter