use of android.support.design.widget.FloatingActionButton in project cw-omnibus by commonsguy.
the class AsyncDemoFragment method onViewCreated.
@Override
public void onViewCreated(View v, Bundle savedInstanceState) {
super.onViewCreated(v, savedInstanceState);
getListView().setScrollbarFadingEnabled(false);
setListAdapter(adapter);
FloatingActionButton fab = (FloatingActionButton) v.findViewById(R.id.refresh);
fab.setOnClickListener(this);
}
use of android.support.design.widget.FloatingActionButton in project cheesesquare by chrisbanes.
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);
final ActionBar ab = getSupportActionBar();
ab.setHomeAsUpIndicator(R.drawable.ic_menu);
ab.setDisplayHomeAsUpEnabled(true);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
if (navigationView != null) {
setupDrawerContent(navigationView);
}
ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
if (viewPager != null) {
setupViewPager(viewPager);
}
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Here's a Snackbar", Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
});
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(viewPager);
}
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 NewPipe by TeamNewPipe.
the class VideoItemDetailFragment method onStart.
@Override
public void onStart() {
super.onStart();
Activity a = getActivity();
infoItemBuilder = new InfoItemBuilder(a, a.findViewById(android.R.id.content));
if (android.os.Build.VERSION.SDK_INT < 18) {
playVideoButton = (FloatingActionButton) a.findViewById(R.id.play_video_button);
}
thumbnailWindowLayout = a.findViewById(R.id.detail_stream_thumbnail_window_layout);
Button backgroundButton = (Button) a.findViewById(R.id.detail_stream_thumbnail_window_background_button);
// Otherwise the applications would crash.
if (backgroundButton != null) {
streamingServiceId = getArguments().getInt(NavStack.SERVICE_ID);
String videoUrl = getArguments().getString(NavStack.URL);
StreamInfoWorker siw = StreamInfoWorker.getInstance();
siw.search(streamingServiceId, videoUrl, getActivity());
autoPlayEnabled = getArguments().getBoolean(AUTO_PLAY);
if (Build.VERSION.SDK_INT >= 18) {
ImageView thumbnailView = (ImageView) activity.findViewById(R.id.detail_thumbnail_view);
thumbnailView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
// This is used to synchronize the thumbnailWindowButton and the playVideoButton
// inside the ScrollView with the actual size of the thumbnail.
//todo: onLayoutChage sometimes not triggered
// background buttons area seem to overlap the thumbnail view
// So although you just clicked slightly beneath the thumbnail the action still
// gets triggered.
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
RelativeLayout.LayoutParams newWindowLayoutParams = (RelativeLayout.LayoutParams) thumbnailWindowLayout.getLayoutParams();
newWindowLayoutParams.height = bottom - top;
thumbnailWindowLayout.setLayoutParams(newWindowLayoutParams);
//noinspection SuspiciousNameCombination
initialThumbnailPos.set(top, left);
}
});
}
}
}
use of android.support.design.widget.FloatingActionButton in project actor-platform by actorapp.
the class ComposeFabFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View res = inflater.inflate(R.layout.fragment_fab, container, false);
FloatingActionButton fabRoot = (FloatingActionButton) res.findViewById(R.id.fab);
fabRoot.setImageResource(R.drawable.ic_edit_white_24dp);
fabRoot.setBackgroundTintList(new ColorStateList(new int[][] { new int[] { android.R.attr.state_pressed }, StateSet.WILD_CARD }, new int[] { ActorSDK.sharedActor().style.getFabPressedColor(), ActorSDK.sharedActor().style.getFabColor() }));
fabRoot.setRippleColor(ActorSDK.sharedActor().style.getFabPressedColor());
fabRoot.setOnClickListener(v -> startActivity(new Intent(getActivity(), ComposeActivity.class)));
return res;
}
Aggregations