All Projects → florent37 → Inlineactivityresult

florent37 / Inlineactivityresult

Licence: mit
Receive the activity result directly after the startActivityForResult with InlineActivityResult

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to Inlineactivityresult

Bundler
🎁 Android Intent & Bundle extensions that insert and retrieve values elegantly.
Stars: ✭ 195 (-26.14%)
Mutual labels:  intent, activity, fragment
Navigator
Android Multi-module navigator, trying to find a way to navigate into a modularized android project
Stars: ✭ 131 (-50.38%)
Mutual labels:  intent, activity, fragment
RxComponentLifecycle
Rx binding of new Android Architecture Component Lifecycle
Stars: ✭ 57 (-78.41%)
Mutual labels:  fragment, rx, activity
Runtimepermission
Simpliest way to ask runtime permissions on Android, no need to extend class or override permissionResult method, choose your way : Kotlin / Coroutines / RxJava / Java7 / Java8
Stars: ✭ 860 (+225.76%)
Mutual labels:  lambda, rx
Swiftcoroutine
Swift coroutines for iOS, macOS and Linux.
Stars: ✭ 690 (+161.36%)
Mutual labels:  thread, coroutine
Taskmanager
A simple、 light(only two file)、fast 、powerful 、easy to use 、easy to extend 、 Android Library To Manager your AsyncTask/Thread/CallBack Jobqueue ! 一个超级简单,易用,轻量级,快速的异步任务管理器,类似于AsyncTask,但是比AsyncTask更好用,更易控制,从此不再写Thread ! ^_^
Stars: ✭ 25 (-90.53%)
Mutual labels:  thread, callback
Base
🍁 Base是针对于Android开发封装好一些常用的基类,主要包括通用的Adapter、Activity、Fragment、Dialog等、和一些常用的Util类,只为更简单。
Stars: ✭ 249 (-5.68%)
Mutual labels:  activity, fragment
YACLib
Yet Another Concurrency Library
Stars: ✭ 193 (-26.89%)
Mutual labels:  thread, coroutine
Bracer
Pass parameters safely and quickly between activities or fragments.
Stars: ✭ 57 (-78.41%)
Mutual labels:  intent, fragment
hpc
Learning and practice of high performance computing (CUDA, Vulkan, OpenCL, OpenMP, TBB, SSE/AVX, NEON, MPI, coroutines, etc. )
Stars: ✭ 39 (-85.23%)
Mutual labels:  thread, coroutine
ProtoPromise
Robust and efficient library for management of asynchronous operations in C#/.Net.
Stars: ✭ 20 (-92.42%)
Mutual labels:  callback, coroutine
Yappi
Yet Another Python Profiler, but this time thread&coroutine&greenlet aware.
Stars: ✭ 595 (+125.38%)
Mutual labels:  thread, coroutine
BindingExtension
Android ViewBinding extension to provide simpler usage in Activity, Fragment and ViewHolder.
Stars: ✭ 26 (-90.15%)
Mutual labels:  fragment, activity
solid
Solid Android components
Stars: ✭ 33 (-87.5%)
Mutual labels:  fragment, activity
Unitask
Provides an efficient allocation free async/await integration for Unity.
Stars: ✭ 2,547 (+864.77%)
Mutual labels:  thread, coroutine
intentanimation
animattion between activities
Stars: ✭ 117 (-55.68%)
Mutual labels:  intent, activity
Rxlifecycle
Rx binding of stock Android Activities & Fragment Lifecycle, avoiding memory leak
Stars: ✭ 131 (-50.38%)
Mutual labels:  activity, fragment
Binding
Simple API implement DataBinding and ViewBinding. 简单的 API 实现 DataBinding 和 ViewBinding,欢迎 star
Stars: ✭ 169 (-35.98%)
Mutual labels:  activity, fragment
My Android Garage
A quick reference guide for Android development.
Stars: ✭ 66 (-75%)
Mutual labels:  fragment, activity
AppListManager
📱 AppListManager (Android Library) makes managing application and activity lists easy.
Stars: ✭ 59 (-77.65%)
Mutual labels:  intent, activity

Inline Activity Result

Language

Work in progress

Receive the activity result directly after the startActivityForResult with InlineActivityResult, choose your way :

No need to override Activity or FragmentonActivityResult(code, permissions, result)using this library, you just have to execute InlineActivityResult's methods This will not cut your code flow

Supports startIntentSenderForResult

General Usage (cross language)

Download

dependencies {
    implementation 'com.github.florent37:inline-activity-result:(lastest version)'
}
startForResult(this, new Intent(MediaStore.ACTION_IMAGE_CAPTURE), new ActivityResultListener() {
      @Override
      public void onSuccess(Result result) {
          //the started activity result is RESULT_OK
      }

      @Override
      public void onFailed(Result result) {
          //the started activity result is RESULT_CANCEL
      }
});

Kotlin-Coroutines

launch(UI) {
   try {
       val result = startForResult(Intent(MediaStore.ACTION_IMAGE_CAPTURE))

       //use the result, eg:
       val imageBitmap = result.data?.extras?.get("data") as Bitmap
       resultView.setImageBitmap(imageBitmap)
   } catch (e: InlineActivityResultException) {

   }
}

Download

Download

implementation 'com.github.florent37:inline-activity-result-kotlin:(last version)'

Kotlin

startForResult(Intent(MediaStore.ACTION_IMAGE_CAPTURE)) { result ->
     //use the result, eg:
     val imageBitmap = result.data?.extras?.get("data") as Bitmap
     resultView.setImageBitmap(imageBitmap)
}.onFailed { result ->

}

Download

Download

implementation 'com.github.florent37:inline-activity-result-kotlin:(last version)'

RxJava

new RxInlineActivityResult(this).request(new Intent(MediaStore.ACTION_IMAGE_CAPTURE)))
    .subscribe(result -> {
        //use the result, eg:
        Bundle extras = result.getData().getExtras();
        Bitmap imageBitmap = (Bitmap) extras.get("data");
        resultView.setImageBitmap(imageBitmap);
    }, throwable -> {
        if (throwable instanceof RxInlineActivityResult.Error) {
            final Result result = ((RxInlineActivityResult.Error) throwable).getResult();

        }
    })

Download

implementation 'com.github.florent37:inline-activity-result-rx:(last version)'

Java8

new InlineActivityResult(this)
       .startForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE))
       .onSuccess(result -> {
           //use the result, eg:
           Bundle extras = result.getData().getExtras();
           Bitmap imageBitmap = (Bitmap) extras.get("data");
           resultView.setImageBitmap(imageBitmap);
       })
       .onFail(result -> {
            
       });

Download

Download

implementation 'com.github.florent37:inline-activity-result:(last version)'

Java7

InlineActivityResult.startForResult(this, new Intent(MediaStore.ACTION_IMAGE_CAPTURE), new ActivityResultListener() {
      @Override
      public void onSuccess(Result result) {
          Bundle extras = result.getData().getExtras();
          Bitmap imageBitmap = (Bitmap) extras.get("data");
          resultView.setImageBitmap(imageBitmap);
      }

      @Override
      public void onFailed(Result result) {

      }
});

StartIntentSenderForResult

Also supports startIntentSenderForResult, as example:

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

PendingIntent pendingIntent = PendingIntent.getActivity(getBaseContext(), 0, intent, 0);

Request request = RequestFabric.create(pendingIntent.getIntentSender(), null, 0, 0, 0, null);

new InlineActivityResult(this)
         .startForResult(request)
         .onSuccess(result -> {
             Bundle extras = result.getData().getExtras();
             Bitmap imageBitmap = (Bitmap) extras.get("data");
             resultView.setImageBitmap(imageBitmap);
          })
          .onFail(result -> {

          });

How to Contribute

We welcome your contributions to this project.

The best way to submit a patch is to send us a pull request.

To report a specific problem or feature request, open a new issue on Github.

Credits

Author: Florent Champigny

Blog : http://www.tutos-android-france.com/

Fiches Plateau Moto : https://www.fiches-plateau-moto.fr/

Android app on Google Play Follow me on Google+ Follow me on Twitter Follow me on LinkedIn

License

Copyright 2018 florent37, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].