Android: filtering intents with an URL to Docs is not possible

The Android platform forces to specify a full hostname which is variable in our case
This commit is contained in:
jendib 2014-11-30 22:02:07 +01:00
parent 551c10e7a3
commit 13e8b828ac
5 changed files with 8 additions and 13 deletions

View File

@ -18,14 +18,12 @@
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activity.MainActivity"
android:label="@string/app_name"
android:logo="@drawable/ic_launcher"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
@ -33,14 +31,12 @@
<meta-data android:name="android.app.searchable" android:resource="@xml/searchable" />
</activity>
<activity
android:name=".activity.DocumentActivity"
android:label=""
android:logo="@drawable/ic_launcher">
android:name=".activity.DocumentViewActivity"
android:label="">
</activity>
<activity
android:name=".activity.DocumentEditActivity"
android:label="@string/new_document"
android:logo="@drawable/ic_launcher">
android:label="@string/new_document">
</activity>
<provider android:name=".provider.RecentSuggestionsProvider"
android:exported="false"

View File

@ -20,7 +20,6 @@ public class MainApplication extends Application {
JSONObject json = PreferenceUtil.getCachedJson(getApplicationContext(), PreferenceUtil.PREF_CACHED_USER_INFO_JSON);
ApplicationContext.getInstance().setUserInfo(getApplicationContext(), json);
// TODO Catch view intents pointing to a share and display it
// TODO Fullscreen preview
// TODO Caching preferences
// TODO Documents adding/editing

View File

@ -43,7 +43,7 @@ import de.greenrobot.event.EventBus;
*
* @author bgamard
*/
public class DocumentActivity extends ActionBarActivity {
public class DocumentViewActivity extends ActionBarActivity {
/**
* File view pager.
*/
@ -91,7 +91,7 @@ public class DocumentActivity extends ActionBarActivity {
}
// Setup the activity
setContentView(R.layout.document_activity);
setContentView(R.layout.document_view_activity);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
@ -162,7 +162,7 @@ public class DocumentActivity extends ActionBarActivity {
@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
JSONArray files = response.optJSONArray("files");
filePagerAdapter = new FilePagerAdapter(DocumentActivity.this, files);
filePagerAdapter = new FilePagerAdapter(DocumentViewActivity.this, files);
fileViewPager.setAdapter(filePagerAdapter);
progressBar.setVisibility(View.GONE);

View File

@ -14,8 +14,8 @@ import android.widget.TextView;
import android.widget.Toast;
import com.sismics.docs.R;
import com.sismics.docs.activity.DocumentActivity;
import com.sismics.docs.activity.DocumentEditActivity;
import com.sismics.docs.activity.DocumentViewActivity;
import com.sismics.docs.adapter.DocListAdapter;
import com.sismics.docs.event.SearchEvent;
import com.sismics.docs.listener.JsonHttpResponseHandler;
@ -86,7 +86,7 @@ public class DocListFragment extends Fragment {
public void onItemClick(View view, int position) {
JSONObject document = adapter.getItemAt(position);
if (document != null) {
Intent intent = new Intent(getActivity(), DocumentActivity.class);
Intent intent = new Intent(getActivity(), DocumentViewActivity.class);
intent.putExtra("document", document.toString());
startActivity(intent);
}