/*
* ******************************************************************************
* * Copyright (c) 2015. Shahul Hameed.
* *
* * Licensed under GNU GENERAL PUBLIC LICENSE;
* * you may not use this file except in compliance with the License.
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* ******************************************************************************
*/
package com.shahul3d.indiasatelliteweather.controllers;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.shahul3d.indiasatelliteweather.R;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.ViewById;
@EActivity(R.layout.activity_main_map)
public class AnimatedMapActivity extends AppCompatActivity {
private String titles[] = new String[]{"Ultra Violet", "Color Composite", "Infra Red", "Wind Direction"};
@ViewById(R.id.drawer_layout)
DrawerLayout mDrawerLayout;
ActionBarDrawerToggle drawerToggle;
@ViewById(R.id.navdrawer)
ListView mDrawerList;
@ViewById(R.id.toolbar)
Toolbar toolbar;
// @ViewById
// NumberProgressBar number_progress_bar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@AfterViews
protected void init() {
initToolbar();
initDrawer();
// Log.d("Storage path: %s", storageUtils.getExternalStoragePath());
}
private void initDrawer() {
drawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, toolbar, R.string.drawer_open, R.string.drawer_close);
mDrawerLayout.setDrawerListener(drawerToggle);
String[] values = new String[]{
"Ultra Violet", "Color Composite", "Infra Red", "Wind Direction"
};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, android.R.id.text1, values);
mDrawerList.setAdapter(adapter);
}
private void initToolbar() {
if (toolbar != null) {
setSupportActionBar(toolbar);
toolbar.setNavigationIcon(R.drawable.ic_ab_drawer);
toolbar.inflateMenu(R.menu.menu_main_map);
}
// number_progress_bar.setSuffix("% Downloading ");
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
drawerToggle.syncState();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
drawerToggle.onConfigurationChanged(newConfig);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main_map, menu);
return true;
}
}