Commit f78cf5f0 authored by Grigory Fedorov's avatar Grigory Fedorov

"Under construction" message added for Recent chats screen.

parent 109bb1cf
......@@ -6,6 +6,7 @@ import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
......@@ -18,7 +19,7 @@ import com.xabber.androiddev.R;
import java.util.ArrayList;
import java.util.List;
public class RecentChatFragment extends ListFragment {
public class RecentChatFragment extends ListFragment implements Toolbar.OnMenuItemClickListener {
private RecentChatFragmentInteractionListener listener;
public static RecentChatFragment newInstance() {
......@@ -75,6 +76,8 @@ public class RecentChatFragment extends ListFragment {
NavUtils.navigateUpFromSameTask(getActivity());
}
});
toolbar.inflateMenu(R.menu.recent_chats);
toolbar.setOnMenuItemClickListener(this);
return rootView;
}
......@@ -109,6 +112,15 @@ public class RecentChatFragment extends ListFragment {
}
}
@Override
public boolean onMenuItemClick(MenuItem item) {
if (item.getItemId() == R.id.action_under_construction) {
Toast.makeText(getActivity(), getActivity().getString(R.string.under_construction_message), Toast.LENGTH_SHORT).show();
}
return false;
}
public interface RecentChatFragmentInteractionListener {
void onChatSelected(AbstractChat chat);
}
......
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_under_construction"
android:title="@string/under_construction"
app:showAsAction="always"
android:orderInCategory="100"
android:icon="@drawable/ic_alert_white_24dp"
/>
</menu>
\ No newline at end of file
......@@ -149,4 +149,7 @@
<string name="otr_verify_secret">Проверка секретным ключом</string>
<string name="recent_chats">Недавние чаты</string>
<string name="under_construction">В разработке</string>
<string name="under_construction_message">Этот экран находится в разработке</string>
</resources>
\ No newline at end of file
......@@ -149,4 +149,7 @@
<string name="otr_verify_secret">Verify with shared secret</string>
<string name="recent_chats">Recent chats</string>
<string name="under_construction">Under construction</string>
<string name="under_construction_message">This screen is under construction</string>
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment