This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.support.v7.widget.RecyclerView; | |
| import android.view.MotionEvent; | |
| import android.view.View; | |
| public abstract class SingleSelectableViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements View.OnTouchListener { | |
| private int mItemPressedPos = -1; | |
| @Override | |
| public boolean onTouch(View view, MotionEvent event) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.support.v4.view.MotionEventCompat; | |
| import android.view.MotionEvent; | |
| public class TouchUtils { | |
| public static int getAction(MotionEvent event) { | |
| return MotionEventCompat.getActionMasked(event); | |
| } | |
| public static int getPointerIndex(MotionEvent event) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.content.Context; | |
| import android.graphics.Canvas; | |
| import android.util.AttributeSet; | |
| import android.util.Log; | |
| import android.view.MotionEvent; | |
| import android.widget.RelativeLayout; | |
| import travel.ozon.mobile.view.utils.OnInterceptTouchEventListener; | |
| public class RelativeLayoutEx extends RelativeLayout { | |
| private static final String TAG = "RelativeLayoutEx"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.view.LayoutInflater; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import android.widget.*; | |
| public abstract class NothingSelectedSpinnerAdapter<T> extends BaseAdapter { | |
| private static final int DUMMY_DROPDOWN_VIEW_TYPE_TAG = 1; | |
| private final Spinner mSpinner; | |
| private T mNothingSelectedDataItem; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Copyright (C) 2008 The Android Open Source Project | |
| * | |
| * 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class GeoLocationUtils { | |
| private static final double EARTH_RADIUS = 6371000; | |
| private static final double EARTH_CIRCLE_LENGTH = 2 * Math.PI * EARTH_RADIUS; | |
| private static final double DISTANCE_PER_EARTH_CIRCLE_DEGREE = Math.PI * EARTH_RADIUS / 180; | |
| /** | |
| * @see <a href="http://en.wikipedia.org/wiki/Great-circle_distance">Great-circle distance</a> | |
| */ | |
| public static double getDistance(double latitude0, double longitude0, double latitude1, double longitude1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.content.Context; | |
| import android.content.res.TypedArray; | |
| import android.util.AttributeSet; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import android.widget.LinearLayout; | |
| // only horizontal now | |
| // use with MATCH_PARENT or exact width attribute | |
| public class LinearLayoutWeighted extends ViewGroup { |