use of android.support.design.widget.FloatingActionButton in project HotFix by dodola.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
});
}
use of android.support.design.widget.FloatingActionButton in project Pokemap by omkarmoghe.
the class MapWrapperFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
locationManager = LocationManager.getInstance(getContext());
nianticManager = NianticManager.getInstance();
locationManager.register(new LocationManager.Listener() {
@Override
public void onLocationChanged(Location location) {
if (mLocation == null) {
mLocation = location;
initMap(true, true);
} else {
mLocation = location;
}
}
@Override
public void onLocationFetchFailed(@Nullable ConnectionResult connectionResult) {
showLocationFetchFailed();
}
});
// Inflate the layout for this fragment if the view is not null
if (mView == null)
mView = inflater.inflate(R.layout.fragment_map_wrapper, container, false);
else {
}
// build the map
if (mSupportMapFragment == null) {
mSupportMapFragment = SupportMapFragment.newInstance();
getChildFragmentManager().beginTransaction().replace(R.id.map, mSupportMapFragment).commit();
mSupportMapFragment.setRetainInstance(true);
}
if (mGoogleMap == null) {
mSupportMapFragment.getMapAsync(this);
}
FloatingActionButton locationFab = (FloatingActionButton) mView.findViewById(R.id.location_fab);
locationFab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (mLocation != null && mGoogleMap != null) {
mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(mLocation.getLatitude(), mLocation.getLongitude()), 15));
} else {
showLocationFetchFailed();
}
}
});
mView.findViewById(R.id.closeSuggestions).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
hideMapSuggestion();
}
});
if (!mPref.getShowMapSuggestion()) {
hideMapSuggestion();
}
return mView;
}
use of android.support.design.widget.FloatingActionButton in project dev-summit-architecture-demo by yigit.
the class FeedActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getComponent().inject(this);
long userId = getIntent().getLongExtra(EXTRA_USER_ID, -1);
mUserId = userId == -1 ? null : userId;
if (mUserId == null) {
setTitle(R.string.feed_title);
} else {
String name = getIntent().getStringExtra(EXTRA_USER_NAME);
setTitle(getString(R.string.user_feed_title, name));
}
mBinding = DataBindingUtil.setContentView(this, R.layout.activity_feed);
boolean showInput = mUserId == null || mUserId == mDemoConfig.getUserId();
mBinding.inputText.setVisibility(showInput ? View.VISIBLE : View.GONE);
String predefinedInput = getIntent().getStringExtra(EXTRA_POST_TEXT);
if (StringUtils.isNotBlank(predefinedInput)) {
mBinding.inputText.setText(predefinedInput);
}
initRecyclerView();
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
sendPost();
}
});
mBinding.swipeContainer.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
mFeedController.fetchFeedAsync(true, mUserId);
}
});
}
use of android.support.design.widget.FloatingActionButton in project Synthese_2BIN by TheYoungSensei.
the class ItemListActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_item_list);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setTitle(getTitle());
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
});
View recyclerView = findViewById(R.id.item_list);
assert recyclerView != null;
setupRecyclerView((RecyclerView) recyclerView);
if (findViewById(R.id.item_detail_container) != null) {
// The detail container view will be present only in the
// large-screen layouts (res/values-w900dp).
// If this view is present, then the
// activity should be in two-pane mode.
mTwoPane = true;
}
model = ((Builder) getApplication()).getModel();
model.registerObserver(this);
ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
task = new MyTask();
if (networkInfo != null && networkInfo.isConnected()) {
//fetch data
task.execute("http://ws.audioscrobbler.com/2.0/?method=geo.gettopartists&country=belgium&api_key=32ef5df0e36797b605e205529058f3b8&format=json&limit=" + INT);
} else {
//ERROR
}
}
use of android.support.design.widget.FloatingActionButton in project Synthese_2BIN by TheYoungSensei.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
});
}
Aggregations