Skip to content
This repository was archived by the owner on Jul 27, 2019. It is now read-only.

Commit c802e5d

Browse files
committed
Launching the Asset Browser UI with a button.
1 parent 39a0e43 commit c802e5d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

asset-browser-ui/app/src/main/java/com/adobe/assetbrowserui/MainActivity.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,19 @@
1010
import android.view.Menu;
1111
import android.view.MenuItem;
1212
import android.view.View;
13+
import android.widget.Button;
1314

1415
import com.adobe.creativesdk.foundation.auth.AdobeAuthException;
1516
import com.adobe.creativesdk.foundation.auth.AdobeAuthSessionHelper;
1617
import com.adobe.creativesdk.foundation.auth.AdobeAuthSessionLauncher;
1718
import com.adobe.creativesdk.foundation.auth.AdobeUXAuthManager;
19+
import com.adobe.creativesdk.foundation.internal.utils.AdobeCSDKException;
20+
import com.adobe.creativesdk.foundation.storage.AdobeUXAssetBrowser;
1821

1922
public class MainActivity extends AppCompatActivity {
2023

24+
private Button mLaunchAssetBrowserButton;
25+
2126
private AdobeUXAuthManager mUXAuthManager = AdobeUXAuthManager.getSharedAuthManager();
2227
private AdobeAuthSessionHelper mAuthSessionHelper;
2328

@@ -31,6 +36,16 @@ protected void onCreate(Bundle savedInstanceState) {
3136
mAuthSessionHelper = new AdobeAuthSessionHelper(mStatusCallback);
3237
mAuthSessionHelper.onCreate(savedInstanceState);
3338

39+
mLaunchAssetBrowserButton = (Button) findViewById(R.id.launchAssetBrowserButton);
40+
41+
View.OnClickListener mLaunchAssetBrowserButtonListener = new View.OnClickListener() {
42+
@Override
43+
public void onClick(View v) {
44+
launchAssetBrowser();
45+
}
46+
};
47+
mLaunchAssetBrowserButton.setOnClickListener(mLaunchAssetBrowserButtonListener);
48+
3449
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
3550
fab.setOnClickListener(new View.OnClickListener() {
3651
@Override
@@ -41,6 +56,17 @@ public void onClick(View view) {
4156
});
4257
}
4358

59+
private void launchAssetBrowser() {
60+
AdobeUXAssetBrowser assetBrowser = AdobeUXAssetBrowser.getSharedInstance();
61+
62+
try {
63+
assetBrowser.popupFileBrowser(this, 300); // Can be any int
64+
}
65+
catch (AdobeCSDKException e) {
66+
Log.e(MainActivity.class.getSimpleName(), "Error: " + e.getMessage());
67+
}
68+
}
69+
4470
private AdobeAuthSessionHelper.IAdobeAuthStatusCallback mStatusCallback;
4571
{
4672
mStatusCallback = new AdobeAuthSessionHelper.IAdobeAuthStatusCallback() {

0 commit comments

Comments
 (0)