Navigation Drawer not occupying the entire screen height - android

I have a drawer layout with drawer on left.
Drawer has a button on click of which I want to replace the view of the drawer with a new view. The problem is , when new view gets replaced it doesn’t occupy the entire screen height.
To illustrate I have given a background colour to my navigation drawer views.
I want the Green view to occupy the entire screen height. Copy-paste the code below to get going:
MainActivity.java
public class MainActivity extends Activity {
LayoutInflater inflater;
DrawerLayout drawer;
RelativeLayout parentRL;
RelativeLayout viewToBeRemovedRL;
View viewToBeAdded;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main_activity);
inflater = (LayoutInflater) this
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
parentRL = (RelativeLayout) findViewById(R.id.parentRL);
viewToBeRemovedRL = (RelativeLayout) findViewById(R.id.viewToBeReplaced);
}
public void onRemoveView(View view) {
viewToBeAdded = inflater.inflate(R.layout.add_view, null);
viewToBeRemovedRL.setVisibility(View.GONE);
parentRL.addView(viewToBeAdded);
}
public void onOpenDrawer(View view) {
drawer.openDrawer(parentRL);
}
}
main_activity.xml
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/leftRL"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:layout_width="wrap_content"
android:layout_height="75dp"
android:onClick="onOpenDrawer"
android:text="Open Drawer" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/parentRL"
android:layout_width="290dp"
android:layout_height="match_parent"
android:layout_gravity="left" >
<RelativeLayout
android:id="#+id/viewToBeReplaced"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF0000" >
<Button
android:layout_width="100dp"
android:layout_height="75dp"
android:onClick="onRemoveView"
android:text="Change View" />
</RelativeLayout>
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>
add_view.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="290dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#00FF00" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
android:text="New view"
/>
</RelativeLayout>

Usually when this happens, the drawer actually DOES occupy the entire screen height, it's just that the default background colour of the view is clear.
Set you RelativeLayout#id/parentRL 's background to a solid colour or some drawable, e.g.
android:background="#android:color/black"
and your drawer should cover the entire screen height.

Related

How to align Button in a custom ToolBar to Right

I have made a custom ToolBar but recently decided to include a button on it as a home button. I have also defined it in java and it works when a button is clicked but the ToolBar title text shows half-way, i have tried to alignParentRight but it wouldn't work.
Please help me
Below are my codes and what i have tried.
TIps_4.java Activity
public class Tips_4 extends AppCompatActivity {
Toolbar toolbar;
TabLayout tabLayout;
ViewPager viewPager;
Button Tips3;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Get the start page passed to us or default to first page
Intent mIntent = getIntent();
int startPage = mIntent.getIntExtra("startPage", 0);
setContentView(R.layout.activity_tips_4);
toolbar= findViewById(R.id.app_bar);
setSupportActionBar(toolbar);
Button toolbar_btn = (Button)findViewById(R.id.toolbarButton);
toolbar_btn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent toolbarIntent = new Intent(Tips_4.this, MainActivity.class);
toolbarIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Tips_4.this.startActivity(toolbarIntent);
setSupportActionBar(toolbar);
}
});
ViewPager viewPager= (ViewPager) findViewById(R.id.view_pager);
viewPager.setAdapter(new SimpleFragmentPageAdapter(getSupportFragmentManager(),this));
// set the current page to the start page
viewPager.setCurrentItem(startPage);
//Attach the page change listener inside the activity
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
// This method will be invoked when a new page becomes selected
#Override
public void onPageSelected(int position) {
Toast.makeText(Tips_4.this, "Selected Maths Page:" + position, Toast.LENGTH_SHORT).show();
}
// This method will be invoked when the current page is scrolled
#Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetpixels) {
}
// Called when the scroll state changes:
//SCROLL_STATE_IDLE, SCROLL_STATE_DRAGGING, SCROLL_STATE_SETTLING
#Override
public void onPageScrollStateChanged(int state) {
}
});
tabLayout= (TabLayout) findViewById(R.id.tab_layout);
tabLayout.setupWithViewPager(viewPager);
}
}
toolbar_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:subtitleTextColor="#FF9800"
android:background="#color/colorPrimary">
<Button
android:id="#+id/toolbarButton"
android:layout_width="60dp"
android:layout_height="50dp"
android:foreground="#drawable/ic_home_24dp"
android:layout_marginLeft="300dp"
android:background="#000"/>
</androidx.appcompat.widget.Toolbar>
This is what i did that refused to work
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:orientation="horizontal"
android:layout_alignParentRight="true">
<Button
android:id="#+id/toolbarButton"
android:layout_width="54dp"
android:layout_height="50dp"
android:background="#056359"
android:layout_gravity="end"
android:padding="11dp"
android:foreground="#drawable/ic_home_24dp" />
</RelativeLayout>
This is the screenshot
Here is the complete code for a toolbar with button at the end
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:subtitleTextColor="#FF9800"
android:background="#color/colorPrimary">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mathematics Pages"
android:textSize="23sp"
android:textColor="#ffffff"
android:textStyle="bold"
android:gravity="right"/>
<Button
android:id="#+id/toolbarButton"
android:layout_width="60dp"
android:layout_height="50dp"
android:foreground="#drawable/ic_home_24dp"
android:layout_alignParentEnd="true"
android:background="#000"
android:layout_alignParentRight="true" />
</RelativeLayout>
</androidx.appcompat.widget.Toolbar>
You can use a relative layout and set its width and height to match_parent now add the button in you're relative layout and set alignParentEnd to true
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:subtitleTextColor="#FF9800"
android:background="#color/colorPrimary">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="#+id/toolbarButton"
android:layout_width="60dp"
android:layout_height="50dp"
android:foreground="#drawable/ic_home"
android:layout_alignParentEnd="true"
android:background="#000"/>
</RelativeLayout>
</androidx.appcompat.widget.Toolbar>
If you just want a icon in you're button you can use a ImageButton that works same as a normal button. And If you're icon is of fixed size say 24 X 24 then you can make the button as wrap_content in both width and height.

DrawerLayout not functioning and blocks not related widgets

I havd an Activity which has a TextView and i wanted to add a navigation drawer to that Activity. So I changed my XML and implemented DrawerLayout.
After implementing the DrawerLayout it simply does not functioning(meaning it don't open) and the FrameLayout implemented within the DrawerLayout blocks the not related to the DrawerLayout TextView text.
drawer.xml:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.dl.master.lyrics.lyricsmaster.LyricsActivity"
android:id="#+id/drawer_layout_id"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- The main content view where fragments are loaded -->
<FrameLayout
android:id="#+id/frame_layout_id"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<TextView
android:id="#+id/text_tv_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<!-- The navigation drawer -->
<TextView
android:layout_width="220dp"
android:layout_height="match_parent"
android:text="Try me! NOW"
/>
</android.support.v4.widget.DrawerLayout>
<!--
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/text_tv_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</RelativeLayout>
-->
The TextView inside the LinearLayout is the not related DrawerLayout widgets which cannot be seen. And the other TextView is the navigation drawer TextView. I know the navigation drawer widget has to have android:layout_gravity="start" property but it apparently has no layout parent so AS does not let me write it.
When running the Activity i see the text "Try it NOW" of the navigation drawer TextView and that's all.
DrawerActivity.java:
public class LyricsActivity extends AppCompatActivity
{
private TextView text;
private DrawerLayout drawerLayout;
private ActionBarDrawerToggle actionBarDrawerToggle;
#Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.drawer);
this.initializeViews();
this.actionBarDrawerToggle = new ActionBarDrawerToggle(LyricsActivity.this,this.drawerLayout,
null,R.string.open_drawer_description,R.string.close_drawer_description);
this.drawerLayout.addDrawerListener(actionBarDrawerToggle);
//this.drawerLayout.openDrawer(GravityCompat.START); // java.lang.IllegalArgumentException: No drawer view found with gravity LEFT
}
#Override
protected void onResume()
{
super.onResume();
this.text.setText(getIntent().getStringExtra("Tags"));
}
/**
* Initialize all my views.
*
*/
public void initializeViews()
{
this.lyrics = (TextView) findViewById(R.id.text_tv_id);
this.drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout_id);
}
I read all the documentation and a lot of SO post and nothing helped me nor addressed this kind of problem.
DrawerLayout determines which Views to use as a drawers by their layout_gravity attribute. Simply add this attribute to your TextView with the appropriate value. For example:
<!-- The navigation drawer -->
<TextView
android:layout_width="220dp"
android:layout_height="match_parent"
android:layout_gravity="left|start"
android:text="Try me! NOW"
/>

Remove gap at the top of fragment when actionBar is hidden

I have a problem with a gap being displayed at the top of a fragment when I do actionBar.hide() (btw I don't see this gap on the simulator, only on a real device). I tried this answer and that one, but nothing works. This fragment is inside MainActivity, which loads different fragments when I click on the menu. It's the only fragment where the actionBar (which is custom) should be hidden, so I cannot set the fullscreen flag on MainActivity onCreate() method. How can I redraw the view so the actionBar empty space disappear?
Here is how it looks now:
This is the mainActivty where I load the fragment:
public void onCreate(Bundle savedInstanceState) {
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
super.onCreate(savedInstanceState);
showActionBar();
if(Build.VERSION.SDK_INT >= 21){
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}
setContentView(R.layout.activity_main);
setUpMenu();
}
On click on the menu, I change the fragment accordingly:
#Override
public void onClick(View view) {
if (view == itemProfile){
mActionBar.hide();
ProfileFragment profile = new ProfileFragment();
profile.setUser(AppController.getInstance().getLoggedInUser());
changeFragment(profile);
}
}
And the custom actionBar
private void showActionBar() {
mActionBar = getSupportActionBar();
mActionBar.setDisplayShowHomeEnabled(false);
mActionBar.setDisplayShowTitleEnabled(false);
ColorDrawable colorDrawable = new ColorDrawable(Color.parseColor("#ffffff"));
mActionBar.setBackgroundDrawable(colorDrawable);
LayoutInflater mInflater = LayoutInflater.from(this);
View mCustomView = mInflater.inflate(R.layout.custom_actionbar, null);
mTitleTextView = (TextView) mCustomView.findViewById(R.id.title_text);
mLogo = (ImageView) mCustomView.findViewById(R.id.logo);
ImageButton menuButton = (ImageButton) mCustomView
.findViewById(R.id.menu);
menuButton.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
if (resideMenu.isOpened()) {
resideMenu.closeMenu();
} else {
resideMenu.openMenu();
}
}
});
ImageButton mapButton = (ImageButton) mCustomView
.findViewById(R.id.map);
mapButton.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent i = new Intent(getApplicationContext(), MapsActivity.class);
startActivity(i);
}
});
mActionBar.setCustomView(mCustomView);
mActionBar.setDisplayShowCustomEnabled(true);
}
My theme:
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="android:colorPrimaryDark">#android:color/black</item>
<item name="android:windowActionBarOverlay">true</item>
</style>
My mainActivity layout:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:fitsSystemWindows="true"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout
android:id="#+id/main"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="#+id/main_fragment">
</FrameLayout>
</LinearLayout>
</FrameLayout>
</FrameLayout>
My custom actionBar
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#color/transparent">
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#color/transparent">
<TextView
android:id="#+id/title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="7dp"
android:fontFamily="sans-serif-light"
android:text="#string/app_title"
android:textSize="#dimen/textsize_large"
android:textColor="#android:color/black"
android:layout_gravity="center"
android:visibility="gone"/>
<ImageView
android:id="#+id/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="7dp"
android:layout_gravity="center"
android:src="#drawable/logo"
android:background="#color/transparent" />
<ImageButton android:src="#drawable/earth"
android:background="?attr/actionBarItemBackground"
android:layout_width="?attr/actionBarSize"
android:layout_height="20dp"
android:scaleType="centerInside"
android:id="#+id/map"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_gravity="right|center_vertical"
android:layout_marginRight="-15dp"
android:tint="#color/black"/>
<ImageButton android:src="#drawable/titlebar_menu_selector"
android:background="?attr/actionBarItemBackground"
android:layout_width="?attr/actionBarSize"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:id="#+id/menu"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="-15dp"
android:layout_gravity="left|center_vertical"
android:tint="#color/black"/>
</FrameLayout>
</RelativeLayout>
Any help would be great, I've been fighting with it for days now and I really don't know what to do...
If you have created Bottom Navigation Activity and you don't want the hidden ActionBar's blank gap, Check the Host activities layout XML file,
delete the line mentioned below
android:paddingTop="?attr/actionBarSize"
replace
mActionBar.hide();
with
mActionBar.setVisibility(View.GONE);
You need to add Toolbar to your Activity layout. Find the code snippet below for simple Toolbar Layout.
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:minHeight="?attr/actionBarSize"
android:background="#2196F3"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</android.support.v7.widget.Toolbar>
Apply the theme to Activity. Here in this step you need to apply the theme which we have created in step-1 to your activity. This can be done, by using android:theme attribute in your application AndroidManifest.xml.
<activity
android:name="com.javatechig.sample.MyActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
</activity>
Now you are almost ready. You just need to instantiate the Toolbar and add it to your activity by using setSupportActionBar(Toolbar) method.
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
public class MyActivity extends ActionBarActivity{
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my);
// Set a toolbar to replace the action bar.
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
}
}
Visit the below link to know more..
Using Toolbar as ActionBar
Put this line on your toolbar help me clear the gap, don't know will it works on other components like ur Relative layout. Hope helpful :)
android:fitsSystemWindows="true"
like this
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fitsSystemWindows="true" //add this line
android:background="#color/transparent">

how to change image inside sliding drawer on touch?

I am having an sliding drawer opening from right to left navigation when i touch the drawer icon on action bar. Working fine and closing on toggling the icon. no problem
I followed http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/
In the sliding layout I have one small icon vibrate_ON.png.
Now i want when i touch the image in the sliding menu it will be changed to vibrate_OFF and so on toggling, keeping the sliding menu open.
how to do that?
You could do something like:
vibrateImageOn.setOnClickListener(new OnClickListener() {
#Override public void onClick(View v) {
vibrateImageOff.setVisibility(View.Visible);
vibrateImageOn.setVisibility(View.GONE);
}
});
vibrateImageOff.setOnClickListener(new OnClickListener() {
#Override public void onClick(View v) {
vibrateImageOn.setVisibility(View.Visible);
vibrateImageOff.setVisibility(View.GONE);
}
});
Assuming you load them both into ImageViews and they have equal positions, then this should work. Though, it is a bit messy..
You can put a layout in sliding menu for more controls. To do that, you must do some step:
1) Layout:
<android.support.v4.widget.DrawerLayout
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical">
<!-- The main content view -->
<FrameLayout
android:id="#+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f4f4f4" />
<!-- The navigation drawer -->
<LinearLayout
android:id="#+id/linearLayout"
android:layout_width="220dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="#android:color/transparent"
android:dividerHeight="0dp"
android:background="#fff">
<!-- you can set any layout here -->
<TextView
android:id="#+id/tv_word"
android:text="New words"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:layout_width="210dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
2) Handle Event (plz don't forget closeDrawer)
DrawerLayout mDrawerLayout = (DrawerLayout)findViewById(R.id.drawer_layout);
LinearLayout linearLayout = (LinearLayout)findViewById(R.id.linearLayout);
TextView tv_word = (TextView )findViewById(R.id.tv_word );
tv_word.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
mDrawerLayout.closeDrawer(linearLayout);//don't forget it
//.....
}
});

Android NavigationDrawer items don't click

I'm using Android NavigationDrawer without Listview items into slide menu, after creating and changing that slide menu items don't click and don't work to handle to click, for example this below code is my XML layout:
<android.support.v4.widget.DrawerLayout
android:id="#+id/drawer_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="#+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/create_new_waybill"
android:gravity="center_vertical"
android:orientation="vertical"
android:layout_margin="5dp"
android:clickable="true">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/icon_add_waybill"
android:layout_gravity="center"/>
<com.sample.app.Widgets.TextViewStyle
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="#dimen/normal_text_size"
android:text="#string/slidemenu_waybill"
app:fonttype="mjbeirut"
android:textColor="#000000"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/mainViewFragments"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
In this XML I want to show Toast after clicking on create_new_waybill id.
my Activity
public class ActivityMain extends FragmentActivity {
private DrawerLayout mDrawerLayout;
private LinearLayout mSlideMenuContainer;
private ActionBarDrawerToggle mDrawerToggle;
private String[] items;
private UiFiller uiFiller;
private int currentSelectedSlideMenuItem;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
G.currentActivity = this;
/* Getting reference to the DrawerLayout */
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mSlideMenuContainer = (LinearLayout) findViewById(R.id.slide_menu);
LinearLayout create_new_waybill = (LinearLayout) findViewById(R.id.create_new_waybill);
create_new_waybill.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Log.e("ffffffffffff","aaaaaaa");
}
});
/* Initials UI widgets */
uiFiller = new UiFiller(getWindow().getDecorView());
/* Setting default fragment */
currentSelectedSlideMenuItem = 0;
updateFragment(currentSelectedSlideMenuItem);
}
}
Try setting these 3 attributes for ImageView and TextViewStyle:
android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"
and replace Log.e("ffffffffffff","aaaaaaa");
with:
Toast.makeText(view.getContext(), "Some text", Toast.LENGTH_SHORT).show();

Categories

Resources