Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Add highlight and show how to use some features #210

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
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ dependencies {
compile 'commons-lang:commons-lang:2.6'
compile 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.amlcurran.showcaseview:library:5.4.3'
compile('com.crashlytics.sdk.android:crashlytics:2.6.2@aar') {
transitive = true;
}
Expand Down
51 changes: 51 additions & 0 deletions app/src/debug/res/show_feature.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="40dp"
android:src="@drawable/privatechat"
android:layout_alignParentBottom="true" />

<TextView
android:layout_width="50dp"
android:layout_height="20dp"
android:id="@+id/private_chat"
android:layout_marginTop="60dp"
android:layout_marginLeft="80dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />

<TextView
android:layout_width="20dp"
android:layout_height="20dp"

android:layout_marginTop="60dp"
android:layout_marginLeft="120dp"
android:id="@+id/press_button"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/search_view"
android:layout_toEndOf="@+id/search_view" />

<TextView
android:layout_width="150dp"
android:layout_height="100dp"
android:id="@+id/results"
android:layout_marginLeft="80dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="200dp" />

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Continue"
android:id="@+id/button"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />

</RelativeLayout>
35 changes: 33 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zulip.android"
>
package="com.zulip.android">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
Expand Down Expand Up @@ -32,6 +31,38 @@

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

</activity>

<activity
android:name=".activities.MessageExplain"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask" >

</activity>

<activity
android:name=".activities.ShowFeature"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask" >

</activity>
<activity
android:name=".activities.ChatBoxFeature"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask" >

</activity>

<activity
android:name=".activities.StreamPicker"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask" >

</activity>
<activity
android:name=".activities.LoginActivity"
Expand Down
63 changes: 63 additions & 0 deletions app/src/main/java/com/zulip/android/activities/ChatBoxFeature.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package com.zulip.android.activities;


/**
* Created by Minarva on 12-10-16.
*/
import android.app.ExpandableListActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Paint;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextPaint;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.zulip.android.R;
import com.github.amlcurran.showcaseview.ShowcaseView;
import com.github.amlcurran.showcaseview.targets.ViewTarget;

public class ChatBoxFeature extends AppCompatActivity {
ShowcaseView showcaseView;
TextView body;
int flag;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.chat_box_feature);
final Button startButton = (Button)findViewById(R.id.button);
final TextPaint titlePaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
titlePaint.setTextSize(44.0f);

showcaseView = new ShowcaseView.Builder(this)
.withNewStyleShowcase()
.setTarget(new ViewTarget(R.id.chatbox, this))
.setContentTitle("Swipe left or right to remove the chat box")
.setStyle(R.style.CustomShowcaseTheme2)
.build();
flag = 0;
body = (TextView)findViewById(R.id.switch_stream);
startButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(flag == 0) {
showcaseView = new ShowcaseView.Builder(ChatBoxFeature.this)
.withNewStyleShowcase()
.setTarget(new ViewTarget(R.id.switch_stream, ChatBoxFeature.this)).setContentTitlePaint(titlePaint)
.setContentTitle("Press here to choose a stream")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we usually use "Tap" here instead of "Press".

.setStyle(R.style.CustomShowcaseTheme2)
.build();
showcaseView.show();
flag = 1;

}else{
Intent i = new Intent(ChatBoxFeature.this, StreamPicker.class);
startActivity(i);
}

}
});
}
}
50 changes: 50 additions & 0 deletions app/src/main/java/com/zulip/android/activities/MessageExplain.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package com.zulip.android.activities;

/**
* Created by Minarva on 11-10-16.
*/
import android.app.ExpandableListActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Paint;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextPaint;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.zulip.android.R;
import com.github.amlcurran.showcaseview.ShowcaseView;
import com.github.amlcurran.showcaseview.targets.ViewTarget;

public class MessageExplain extends AppCompatActivity {
ShowcaseView showcaseView;
TextView body;
int flag;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.message_explain);
final Button startButton = (Button)findViewById(R.id.start_button);
final TextPaint titlePaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
titlePaint.setTextSize(44.0f);

showcaseView = new ShowcaseView.Builder(this)
.withNewStyleShowcase()
.setTarget(new ViewTarget(R.id.more_options, this))
.setContentTitle("Long press on the Message to get more options")
.setStyle(R.style.CustomShowcaseTheme2)
.build();
flag = 0;
body = (TextView)findViewById(R.id.more_options);
startButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(MessageExplain.this, ShowFeature.class);
startActivity(i);

}
});
}
}
54 changes: 54 additions & 0 deletions app/src/main/java/com/zulip/android/activities/ShowFeature.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.zulip.android.activities;

/**
* Created by Minarva on 11-10-16.
*/
import android.app.ExpandableListActivity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Paint;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextPaint;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.zulip.android.R;
import com.github.amlcurran.showcaseview.ShowcaseView;
import com.github.amlcurran.showcaseview.targets.ViewTarget;

public class ShowFeature extends AppCompatActivity {
ShowcaseView showcaseView;
int flag;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.show_feature);
showcaseView = new ShowcaseView.Builder(this)
.withNewStyleShowcase()
.setTarget(new ViewTarget(R.id.results, this))
.setContentTitle("Swipe to the Left")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't capitalize Left here.

.setContentText("Find users' online status and start private chat")
.setStyle(R.style.CustomShowcaseTheme2)
.build();

flag = 0;
final Button startButton = (Button)findViewById(R.id.button);

startButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
{

Intent i = new Intent(ShowFeature.this, ChatBoxFeature.class);
startActivity(i);
}

}
});
}
}
53 changes: 53 additions & 0 deletions app/src/main/java/com/zulip/android/activities/StreamPicker.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.zulip.android.activities;

/**
* Created by Minarva on 11-10-16.
*/
import android.app.ExpandableListActivity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Paint;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextPaint;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.zulip.android.R;
import com.github.amlcurran.showcaseview.ShowcaseView;
import com.github.amlcurran.showcaseview.targets.ViewTarget;

public class StreamPicker extends AppCompatActivity {
ShowcaseView showcaseView;


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.stream_picker);
showcaseView = new ShowcaseView.Builder(this)
.withNewStyleShowcase()
.setTarget(new ViewTarget(R.id.results, this))
.setContentText("Switch to a stream and start a chat")
.setStyle(R.style.CustomShowcaseTheme2)
.build();


final Button startButton = (Button)findViewById(R.id.button);

startButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
{

Intent i = new Intent(StreamPicker.this, ZulipActivity.class);
startActivity(i);
}

}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1387,6 +1387,9 @@ public void onClick(
case R.id.logout:
logout();
break;
case R.id.help:
openHelp();
break;
case R.id.legal:
openLegal();
break;
Expand Down Expand Up @@ -1436,7 +1439,10 @@ private void openLegal() {
startActivityForResult(i, 0);
}

public void onConfigurationChanged(Configuration newConfig) {
private void openHelp() {
Intent i = new Intent(this,MessageExplain.class);
startActivity(i);
} public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);

// our display has changed, lets recalculate the spacer
Expand Down
Binary file added app/src/main/res/drawable-hdpi/message.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-hdpi/privatechat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/chatbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/dragleft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/dragleftright.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/streampicker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading