Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

Add custom icons and make them work

More
9 years 5 months ago #11306 by jorisk
Here is the bar_cmd.xml file :
Code:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:minHeight="?attr/actionBarSize" android:background="@color/pdfreaderact_toolbar_background"> <ImageView android:id="@+id/btn_return" android:layout_width="40dp" android:layout_height="40dp" android:layout_centerVertical="true" android:layout_margin="2dp" android:clickable="true" android:icon="@drawable/btn_back" /> <ImageView android:id="@+id/btn_summary" android:layout_width="40dp" android:layout_height="40dp" android:layout_centerVertical="true" android:layout_toRightOf="@id/btn_return" android:layout_toEndOf="@id/btn_return" android:layout_margin="2dp" android:clickable="true" android:icon="@drawable/ic_action_list_2" /> <ImageView android:id="@+id/btn_find" android:layout_width="40dp" android:layout_height="40dp" android:layout_centerVertical="true" android:layout_toRightOf="@id/btn_summary" android:layout_toEndOf="@id/btn_summary" android:layout_margin="2dp" android:clickable="true" android:src="@drawable/ic_action_search" /> </RelativeLayout>
And here is the result:

These are the missing icons:
More
9 years 5 months ago #11307 by nermeen
Please replace:
Code:
android:icon="@drawable/ic_action_list_2" android:icon="@drawable/btn_back"
with:
Code:
android:src="@drawable/ic_action_list_2" android:src="@drawable/btn_back"
More
9 years 5 months ago #11309 by jorisk
Wow, I didn't even see that... Thanks!

For the quit method, I know how and where to make the click method, but I don't know how to make it work because PDFViewAct.onDestroy() is not working from PDFLayoutView, and m_doc.Close() close the document but not the Activity.
More
9 years 5 months ago #11310 by nermeen
You can do as the following;
  1. Create an interface in PDFViewController:
    Code:
    public interface PDFViewControllerListener { public void OnBackClicked(); }
  2. Create a listener variable in PDFViewController:
    Code:
    PDFViewControllerListener mListener;
  3. Pass the listener to the PDFViewController constructor and save it:
    Code:
    public PDFViewController(RelativeLayout parent, PDFLayoutView view, PDFViewControllerListener listener) { mListener = listener;
  4. In the onClick of your button call the listener:
    Code:
    mListener.OnBackClicked();
  5. In the PDFViewAct, pass the listener implementation:
    Code:
    m_controller = new PDFViewController(m_layout, m_view, new PDFViewController.PDFViewControllerListener() { @Override public void OnBackClicked() { finish(); } });
More
9 years 5 months ago #11311 by jorisk
It works thank you!
Time to create page: 0.381 seconds
Powered by Kunena Forum