Card 48 (Apply same as in trovebox-collect sync appearance to trovebox

app)
app:
- MainActivity: replaced onBackPressed with dispatchKeyEvent to overcome
some HE related issues
- SyncFragment: modified isBackKeyOverrode method to support back key in
the firstStepFragment
- SyncImageSlectionFragment: now it extends
common.fragment.sync.SyncImageSelectionFragment so a lot of common code
is removed. Added constructor, implementation of actionButtonPressed,
pageDeactivated method
- res/layout/fragment_sync_select_photos.xml: removed
- libs/*: removed a lot of common jars which are present in common
library

.gitmodules: updated HoloEverywhere path
- submodules/HoloEverywhere: switched to another bugfixing commit and to
repo httpdispatch/HoloEverywhere
This commit is contained in:
Eugene Popovich 2013-12-13 14:19:42 +02:00
parent 55cc2a263b
commit e2ac37972b
13 changed files with 49 additions and 1130 deletions

2
.gitmodules vendored
View file

@ -3,7 +3,7 @@
url = git://github.com/photo/facebook-android-sdk.git url = git://github.com/photo/facebook-android-sdk.git
[submodule "submodules/HoloEverywhere"] [submodule "submodules/HoloEverywhere"]
path = submodules/HoloEverywhere path = submodules/HoloEverywhere
url = git://github.com/Prototik/HoloEverywhere.git url = git://github.com/httpdispatch/HoloEverywhere.git
[submodule "submodules/PhotoView"] [submodule "submodules/PhotoView"]
path = submodules/PhotoView path = submodules/PhotoView
url = https://github.com/chrisbanes/PhotoView.git url = https://github.com/chrisbanes/PhotoView.git

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,9 +1,9 @@
# Project target. # Project target.
target=android-18 target=android-18
android.library.reference.1=../submodules/facebook-android-sdk/facebook android.library.reference.1=..\\common
android.library.reference.2=../submodules/Android-Feather android.library.reference.2=..\\submodules\\facebook-android-sdk\\facebook
android.library.reference.3=../submodules/HoloEverywhere/addons/preferences android.library.reference.3=..\\submodules\\Android-Feather
android.library.reference.4=../submodules/HoloEverywhere/addons/slider android.library.reference.4=..\\submodules\\HoloEverywhere\\addons\\preferences
android.library.reference.5=../submodules/google-play-services_lib android.library.reference.5=..\\submodules\\HoloEverywhere\\addons\\slider
android.library.reference.6=../submodules/viewpagerindicator/library android.library.reference.6=..\\submodules\\google-play-services_lib
android.library.reference.7=../common android.library.reference.7=..\\submodules\\viewpagerindicator\\library

View file

@ -1,48 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:holo="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res/com.trovebox.android.app"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<org.holoeverywhere.widget.Switch
android:id="@+id/uploaded_state_switch"
style="@style/YesNoSwitch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp"
android:checked="false"
android:text="@string/sync_show_all" />
<View
android:layout_width="0dip"
android:layout_height="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/nextBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sync_next_button" />
</LinearLayout>
<GridView
android:id="@+id/grid_photos"
style="@style/PhotoGridLayout"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:columnWidth="@dimen/image_thumbnail_size"
android:horizontalSpacing="@dimen/image_thumbnail_spacing"
android:numColumns="auto_fit"
android:padding="2dp"
android:stretchMode="columnWidth"
android:verticalSpacing="@dimen/image_thumbnail_spacing" />
</LinearLayout>

View file

@ -16,6 +16,7 @@ import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.view.KeyEvent;
import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.Menu;
@ -47,8 +48,8 @@ import com.trovebox.android.common.util.GuiUtils;
import com.trovebox.android.common.util.LoadingControl; import com.trovebox.android.common.util.LoadingControl;
import com.trovebox.android.common.util.ObjectAccessor; import com.trovebox.android.common.util.ObjectAccessor;
import com.trovebox.android.common.util.SyncUtils; import com.trovebox.android.common.util.SyncUtils;
import com.trovebox.android.common.util.TrackerUtils;
import com.trovebox.android.common.util.SyncUtils.SyncStartedHandler; import com.trovebox.android.common.util.SyncUtils.SyncStartedHandler;
import com.trovebox.android.common.util.TrackerUtils;
@Addons(Activity.ADDON_SLIDER) @Addons(Activity.ADDON_SLIDER)
public class MainActivity extends CommonActivity implements LoadingControl, GalleryOpenControl, public class MainActivity extends CommonActivity implements LoadingControl, GalleryOpenControl,
@ -422,17 +423,20 @@ public class MainActivity extends CommonActivity implements LoadingControl, Gall
} }
@Override @Override
public void onBackPressed() { public boolean dispatchKeyEvent(android.view.KeyEvent event) {
Fragment fragment = getCurrentFragment(); final int keyCode = event.getKeyCode();
boolean proceed = true; boolean proceed = true;
if (fragment != null && fragment instanceof BackKeyControl) if (keyCode == KeyEvent.KEYCODE_BACK) {
{ Fragment fragment = getCurrentFragment();
if (fragment != null && fragment instanceof BackKeyControl) {
proceed &= !((BackKeyControl) fragment).isBackKeyOverrode(); proceed &= !((BackKeyControl) fragment).isBackKeyOverrode();
} }
if (proceed)
{
super.onBackPressed();
} }
if (proceed) {
return super.dispatchKeyEvent(event);
}
return proceed;
} }
@Override @Override

View file

@ -313,10 +313,13 @@ public class SyncFragment extends CommonFragment implements NextStepFlow,
@Override @Override
public boolean isBackKeyOverrode() { public boolean isBackKeyOverrode() {
if (activeFragment != null && activeFragment == secondStepFragment) if (activeFragment != null)
{ {
if (activeFragment == secondStepFragment) {
activatePreviousStep(); activatePreviousStep();
return true; } else {
return firstStepFragment.isBackKeyOverrode();
}
} }
return false; return false;
} }

@ -1 +1 @@
Subproject commit 020447990b7d0a1954984a57122b0f027d7bd843 Subproject commit b5b9b87e1a282fafc75a83b4904bb368ed17b690