Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add navigation instruction dialog #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions app/res/layout/initial_dialog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp">

<TextView android:text="@string/init_dialog_str"
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>

<Button android:id="@+id/Button01"
android:layout_below="@id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="Got it!" />

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView_init_nav"
android:src="@drawable/gravatar_icon"
android:layout_alignBottom="@+id/Button01"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />

</RelativeLayout>
4 changes: 4 additions & 0 deletions app/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,8 @@
<string name="delete_successful">Repository is deleted</string>
<string name="login_or_email">Login or Email</string>


<!-- Initial Dialog strings -->
<string name="init_dialog_str">Short Click on the list will take you to the detail page of the news.\n\nLong click will open the dialog to navigate you to the profile page of the user or repo related to the news."</string>

</resources>
2 changes: 2 additions & 0 deletions app/src/main/java/com/github/mobile/ui/BaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

finder = new ViewFinder(this);


}

/**
Expand Down
27 changes: 25 additions & 2 deletions app/src/main/java/com/github/mobile/ui/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.mobile.ui;

import static com.github.mobile.ui.NavigationDrawerObject.TYPE_SEPERATOR;
import android.app.Dialog;
import android.app.SearchManager;
import android.content.Context;
import android.os.Bundle;
Expand All @@ -15,6 +15,7 @@
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.widget.Button;

import com.github.mobile.R;
import com.github.mobile.accounts.AccountUtils;
Expand All @@ -29,10 +30,12 @@
import com.google.inject.Inject;
import com.google.inject.Provider;

import org.eclipse.egit.github.core.User;

import java.util.Collections;
import java.util.List;

import org.eclipse.egit.github.core.User;
import static com.github.mobile.ui.NavigationDrawerObject.TYPE_SEPERATOR;

public class MainActivity extends BaseActivity implements NavigationDrawerFragment.NavigationDrawerCallbacks,
LoaderManager.LoaderCallbacks<List<User>> {
Expand Down Expand Up @@ -171,4 +174,24 @@ public void onNavigationDrawerItemSelected(int position) {
manager.beginTransaction().replace(R.id.container, fragment).commit();
}

@Override
protected void onStart()
{
super.onStart();

final Dialog dialog = new Dialog(this);
dialog.setContentView(R.layout.initial_dialog);
dialog.setTitle("How to navigate");

Button button = (Button) dialog.findViewById(R.id.Button01);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog.dismiss();
}
});

dialog.show();
}

}
17 changes: 10 additions & 7 deletions app/src/main/java/com/github/mobile/ui/NewsFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
*/
package com.github.mobile.ui;

import static android.content.Intent.ACTION_VIEW;
import static android.content.Intent.CATEGORY_BROWSABLE;
import static org.eclipse.egit.github.core.event.Event.TYPE_COMMIT_COMMENT;
import static org.eclipse.egit.github.core.event.Event.TYPE_DOWNLOAD;
import static org.eclipse.egit.github.core.event.Event.TYPE_PUSH;
import android.app.AlertDialog;
import android.content.Intent;
import android.net.Uri;
Expand All @@ -46,8 +41,6 @@
import com.github.mobile.util.AvatarLoader;
import com.google.inject.Inject;

import java.util.List;

import org.eclipse.egit.github.core.Commit;
import org.eclipse.egit.github.core.CommitComment;
import org.eclipse.egit.github.core.Download;
Expand All @@ -61,6 +54,14 @@
import org.eclipse.egit.github.core.event.PushPayload;
import org.eclipse.egit.github.core.service.EventService;

import java.util.List;

import static android.content.Intent.ACTION_VIEW;
import static android.content.Intent.CATEGORY_BROWSABLE;
import static org.eclipse.egit.github.core.event.Event.TYPE_COMMIT_COMMENT;
import static org.eclipse.egit.github.core.event.Event.TYPE_DOWNLOAD;
import static org.eclipse.egit.github.core.event.Event.TYPE_PUSH;

/**
* Base news fragment class with utilities for subclasses to built on
*/
Expand Down Expand Up @@ -100,6 +101,8 @@ public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);

setEmptyText(R.string.no_news);


}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

pager = createPager();

}

/**
Expand Down