Renamed fragments & added statistics to list fragments.

This commit is contained in:
Dmitry Yunitsky 2015-03-11 16:25:55 +03:00 committed by Alex Zolotarev
parent 94b1204bba
commit 482734f8d0
19 changed files with 47 additions and 55 deletions

View file

@ -4,10 +4,10 @@ import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import com.mapswithme.maps.base.MWMFragmentActivity;
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
public class DownloadActivity extends MWMFragmentActivity
public class DownloadActivity extends BaseMwmFragmentActivity
{
private DownloadFragment mDownloadFragment;

View file

@ -12,11 +12,11 @@ import android.widget.TextView;
import com.mapswithme.maps.MWMActivity;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.MWMListFragment;
import com.mapswithme.maps.base.BaseMwmListFragment;
import com.mapswithme.maps.base.OnBackPressListener;
import com.mapswithme.util.UiUtils;
public class DownloadFragment extends MWMListFragment implements View.OnClickListener, ActiveCountryTree.ActiveCountryListener, OnBackPressListener
public class DownloadFragment extends BaseMwmListFragment implements View.OnClickListener, ActiveCountryTree.ActiveCountryListener, OnBackPressListener
{
private ExtendedDownloadAdapterWrapper mExtendedAdapter;
private DownloadedAdapter mDownloadedAdapter;

View file

@ -21,7 +21,7 @@ import com.mapswithme.maps.MWMActivity.OpenUrlTask;
import com.mapswithme.maps.MapStorage.Index;
import com.mapswithme.maps.api.Const;
import com.mapswithme.maps.api.ParsedMmwRequest;
import com.mapswithme.maps.base.MWMFragmentActivity;
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
import com.mapswithme.maps.location.LocationHelper;
import com.mapswithme.util.ConnectionState;
import com.mapswithme.util.Constants;
@ -35,7 +35,7 @@ import java.io.InputStream;
import java.io.OutputStream;
@SuppressLint("StringFormatMatches")
public class DownloadResourcesActivity extends MWMFragmentActivity
public class DownloadResourcesActivity extends BaseMwmFragmentActivity
implements LocationHelper.LocationListener, MapStorage.Listener
{
private static final String TAG = DownloadResourcesActivity.class.getName();

View file

@ -46,7 +46,7 @@ import com.mapswithme.maps.Framework.OnBalloonListener;
import com.mapswithme.maps.MapStorage.Index;
import com.mapswithme.maps.ads.LikesManager;
import com.mapswithme.maps.api.ParsedMmwRequest;
import com.mapswithme.maps.base.MWMFragmentActivity;
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
import com.mapswithme.maps.bookmarks.BookmarkActivity;
import com.mapswithme.maps.bookmarks.BookmarkCategoriesActivity;
import com.mapswithme.maps.bookmarks.data.Bookmark;
@ -84,7 +84,7 @@ import java.io.Serializable;
import java.util.Stack;
import java.util.concurrent.TimeUnit;
public class MWMActivity extends MWMFragmentActivity
public class MWMActivity extends BaseMwmFragmentActivity
implements LocationHelper.LocationListener, OnBalloonListener, View.OnTouchListener, BasePlacePageAnimationController.OnVisibilityChangedListener,
OnClickListener, Framework.RoutingListener, MapFragment.MapRenderingListener
{

View file

@ -1,28 +1,9 @@
package com.mapswithme.maps.base;
import android.os.Bundle;
import android.support.v4.app.Fragment;
public class MWMFragment extends Fragment
public class BaseMwmFragment extends Fragment
{
@Override
public void onCreate(Bundle arg0)
{
super.onCreate(arg0);
}
@Override
public void onStart()
{
super.onStart();
}
@Override
public void onStop()
{
super.onStop();
}
@Override
public void onResume()
{

View file

@ -13,7 +13,7 @@ import com.mapswithme.util.statistics.Statistics;
import ru.mail.mrgservice.MRGService;
public class MWMFragmentActivity extends ActionBarActivity
public class BaseMwmFragmentActivity extends ActionBarActivity
{
@Override
protected void onCreate(Bundle arg0)

View file

@ -8,7 +8,7 @@ import android.view.View;
import com.mapswithme.maps.R;
import com.mapswithme.util.UiUtils;
public abstract class MWMListFragment extends ListFragment
public abstract class BaseMwmListFragment extends ListFragment
{
private Toolbar mToolbar;
@ -27,5 +27,16 @@ public abstract class MWMListFragment extends ListFragment
return mToolbar;
}
// TODO collect some statistics
public void onResume()
{
super.onResume();
org.alohalytics.Statistics.logEvent("$onResume", this.getClass().getSimpleName());
}
@Override
public void onPause()
{
super.onPause();
org.alohalytics.Statistics.logEvent("$onPause", this.getClass().getSimpleName());
}
}

View file

@ -14,7 +14,7 @@ import android.widget.EditText;
import android.widget.TextView;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.MWMFragmentActivity;
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
import com.mapswithme.maps.bookmarks.data.Bookmark;
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
import com.mapswithme.maps.bookmarks.data.Icon;
@ -23,7 +23,7 @@ import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Utils;
import com.mapswithme.util.statistics.Statistics;
public class BookmarkActivity extends MWMFragmentActivity
public class BookmarkActivity extends BaseMwmFragmentActivity
{
public static final String BOOKMARK_POSITION = "bookmark_position";
public static final String PIN = "pin";

View file

@ -5,9 +5,9 @@ import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.MWMFragmentActivity;
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
public class BookmarkCategoriesActivity extends MWMFragmentActivity
public class BookmarkCategoriesActivity extends BaseMwmFragmentActivity
{
@Override
protected void onCreate(Bundle savedInstanceState)

View file

@ -11,10 +11,10 @@ import android.widget.AdapterView;
import android.widget.ListView;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.MWMListFragment;
import com.mapswithme.maps.base.BaseMwmListFragment;
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
public class BookmarkCategoriesFragment extends MWMListFragment
public class BookmarkCategoriesFragment extends BaseMwmListFragment
{
private int mSelectedPosition;

View file

@ -4,10 +4,10 @@ import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import com.mapswithme.maps.base.MWMFragmentActivity;
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
public class BookmarkListActivity extends MWMFragmentActivity
public class BookmarkListActivity extends BaseMwmFragmentActivity
{
@Override
protected void onCreate(Bundle savedInstanceState)

View file

@ -24,7 +24,7 @@ import com.mapswithme.maps.Framework;
import com.mapswithme.maps.MWMActivity;
import com.mapswithme.maps.MWMApplication;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.MWMListFragment;
import com.mapswithme.maps.base.BaseMwmListFragment;
import com.mapswithme.maps.bookmarks.data.Bookmark;
import com.mapswithme.maps.bookmarks.data.BookmarkCategory;
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
@ -32,7 +32,7 @@ import com.mapswithme.maps.bookmarks.data.ParcelablePoint;
import com.mapswithme.maps.bookmarks.data.Track;
import com.mapswithme.util.ShareAction;
public class BookmarksListFragment extends MWMListFragment
public class BookmarksListFragment extends BaseMwmListFragment
{
public static final String TAG = "BookmarkListActivity";

View file

@ -6,9 +6,9 @@ import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import com.mapswithme.maps.base.MWMFragmentActivity;
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
public class ChooseBookmarkCategoryActivity extends MWMFragmentActivity
public class ChooseBookmarkCategoryActivity extends BaseMwmFragmentActivity
{
@Override
protected void onCreate(Bundle arg0)

View file

@ -15,13 +15,13 @@ import android.widget.ListView;
import android.widget.TextView;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.MWMListFragment;
import com.mapswithme.maps.base.BaseMwmListFragment;
import com.mapswithme.maps.bookmarks.data.Bookmark;
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
import com.mapswithme.maps.bookmarks.data.ParcelablePoint;
import com.mapswithme.util.statistics.Statistics;
public class ChooseBookmarkCategoryFragment extends MWMListFragment
public class ChooseBookmarkCategoryFragment extends BaseMwmListFragment
{
private FooterHelper mFooterHelper;
private ChooseBookmarkCategoryAdapter mAdapter;

View file

@ -6,10 +6,10 @@ import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import com.mapswithme.maps.base.MWMFragmentActivity;
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
public class SearchActivity extends MWMFragmentActivity
public class SearchActivity extends BaseMwmFragmentActivity
{
public static final String EXTRA_QUERY = "search_query";

View file

@ -20,7 +20,7 @@ import android.widget.TextView;
import com.mapswithme.maps.MWMActivity;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.MWMListFragment;
import com.mapswithme.maps.base.BaseMwmListFragment;
import com.mapswithme.maps.base.OnBackPressListener;
import com.mapswithme.maps.location.LocationHelper;
import com.mapswithme.util.InputUtils;
@ -30,7 +30,7 @@ import com.mapswithme.util.Utils;
import com.mapswithme.util.statistics.Statistics;
public class SearchFragment extends MWMListFragment implements View.OnClickListener, LocationHelper.LocationListener, OnBackPressListener
public class SearchFragment extends BaseMwmListFragment implements View.OnClickListener, LocationHelper.LocationListener, OnBackPressListener
{
// These constants should be equal with
// Java_com_mapswithme_maps_SearchActivity_nativeRunSearch routine.

View file

@ -5,9 +5,9 @@ import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.MWMFragmentActivity;
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
public class StoragePathActivity extends MWMFragmentActivity
public class StoragePathActivity extends BaseMwmFragmentActivity
{
@Override
protected void onCreate(Bundle savedInstanceState)

View file

@ -6,9 +6,9 @@ import android.content.Intent;
import android.view.View;
import android.widget.ListView;
import com.mapswithme.maps.base.MWMListFragment;
import com.mapswithme.maps.base.BaseMwmListFragment;
public class StoragePathFragment extends MWMListFragment implements StoragePathManager.SetStoragePathListener
public class StoragePathFragment extends BaseMwmListFragment implements StoragePathManager.SetStoragePathListener
{
private StoragePathManager mPathManager = new StoragePathManager();
private StoragePathAdapter mAdapter;

View file

@ -14,11 +14,11 @@ import android.view.View;
import android.view.ViewGroup;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.MWMFragment;
import com.mapswithme.maps.base.BaseMwmFragment;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.StubLogger;
public abstract class NvEventQueueFragment extends MWMFragment implements View.OnTouchListener, View.OnFocusChangeListener
public abstract class NvEventQueueFragment extends BaseMwmFragment implements View.OnTouchListener, View.OnFocusChangeListener
{
private static final String TAG = NvEventQueueFragment.class.getSimpleName();