Оценить:
 Рейтинг: 0

Разработка Android-приложений с Augmented Reality

Год написания книги
2017
<< 1 ... 17 18 19 20 21 22 >>
На страницу:
21 из 22
Настройки чтения
Размер шрифта
Высота строк
Поля

private RadarView mRadarView;

private RadarWorldPlugin mRadarPlugin;

private Location mCurrentLocation;

private Context context;

GoogleApiClient mGoogleApiClient;

LocationRequest mLocationRequest;

private float [] mLastAccelerometer = new float [3];

private float [] mLastMagnetometer = new float [3];

private float [] mR = new float [9];

private float [] mOrientation = new float [3];

private static boolean flagLocationUpdate=true;

private static SharedPreferences mSettings;

private Set <String> boLat=new LinkedHashSet ();

private Set <String> boLon=new LinkedHashSet ();

private static ProgressBar spinner;

@Override

protected void onCreate (Bundle savedInstanceState) {

super. onCreate (savedInstanceState);

setContentView(R.layout.activity_main);

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);

setSupportActionBar (toolbar);

spinner = (ProgressBar)findViewById(R.id.progressBar);

spinner.setVisibility (View. GONE);

DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);

ActionBarDrawerToggle toggle = new ActionBarDrawerToggle (

this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);

drawer.addDrawerListener (toggle);

toggle.syncState ();

NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);

navigationView.setNavigationItemSelectedListener (this);

final NestedScrollView nestedScrollView = (NestedScrollView)findViewById(R.id.content_main);

nestedScrollView.getViewTreeObserver().addOnGlobalLayoutListener (

new ViewTreeObserver. OnGlobalLayoutListener () {

@Override

public void onGlobalLayout () {

int height = nestedScrollView.getHeight ();

int width = nestedScrollView.getWidth ();

if (height> width) height=width;

if (width> height) width=height;

ViewGroup.LayoutParams params = nestedScrollView.getLayoutParams ();

params. width=width;

params. height=height;

nestedScrollView.setLayoutParams (params);

nestedScrollView.getViewTreeObserver().removeGlobalOnLayoutListener (this);

}

});

context = this;

mSettings = getSharedPreferences («APP_PREFERENCES», Context.MODE_PRIVATE);

if (!mSettings.contains («BOLAT»)) {

SharedPreferences. Editor editor = mSettings. edit ();
<< 1 ... 17 18 19 20 21 22 >>
На страницу:
21 из 22