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

Commit 495d7f3

Browse files
committed
Add highlight and show how to use some features
1 parent a475f45 commit 495d7f3

18 files changed

+490
-2
lines changed

app/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ dependencies {
7575
compile 'commons-lang:commons-lang:2.6'
7676
compile 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'
7777
compile 'com.squareup.picasso:picasso:2.5.2'
78+
compile 'com.github.amlcurran.showcaseview:library:5.3.0'
7879
compile('com.crashlytics.sdk.android:crashlytics:2.6.2@aar') {
7980
transitive = true;
8081
}

app/src/debug/res/show_feature.xml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:orientation="vertical" android:layout_width="match_parent"
4+
android:layout_height="match_parent">
5+
<ImageView
6+
android:layout_width="match_parent"
7+
android:layout_height="match_parent"
8+
android:layout_marginBottom="40dp"
9+
android:src="@drawable/privatechat"
10+
android:layout_alignParentBottom="true" />
11+
12+
<TextView
13+
android:layout_width="50dp"
14+
android:layout_height="20dp"
15+
android:id="@+id/private_chat"
16+
android:layout_marginTop="60dp"
17+
android:layout_marginLeft="80dp"
18+
android:layout_alignParentTop="true"
19+
android:layout_alignParentLeft="true"
20+
android:layout_alignParentStart="true" />
21+
22+
<TextView
23+
android:layout_width="20dp"
24+
android:layout_height="20dp"
25+
26+
android:layout_marginTop="60dp"
27+
android:layout_marginLeft="120dp"
28+
android:id="@+id/press_button"
29+
android:layout_alignParentTop="true"
30+
android:layout_toRightOf="@+id/search_view"
31+
android:layout_toEndOf="@+id/search_view" />
32+
33+
<TextView
34+
android:layout_width="150dp"
35+
android:layout_height="100dp"
36+
android:id="@+id/results"
37+
android:layout_marginLeft="80dp"
38+
android:layout_alignParentBottom="true"
39+
android:layout_alignParentLeft="true"
40+
android:layout_alignParentStart="true"
41+
android:layout_marginBottom="200dp" />
42+
43+
<Button
44+
android:layout_width="wrap_content"
45+
android:layout_height="wrap_content"
46+
android:text="Continue"
47+
android:id="@+id/button"
48+
android:layout_alignParentBottom="true"
49+
android:layout_centerHorizontal="true" />
50+
51+
</RelativeLayout>

app/src/main/AndroidManifest.xml

+32-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.zulip.android"
4-
>
3+
package="com.zulip.android">
54

65
<uses-permission android:name="android.permission.INTERNET" />
76
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
@@ -27,12 +26,43 @@
2726
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
2827
android:label="@string/app_name"
2928
android:launchMode="singleTask" >
29+
30+
</activity>
31+
32+
<activity
33+
android:name=".activities.MessageExplain"
34+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
35+
android:label="@string/app_name"
36+
android:launchMode="singleTask" >
3037
<intent-filter>
3138
<action android:name="android.intent.action.MAIN" />
3239

3340
<category android:name="android.intent.category.LAUNCHER" />
3441
</intent-filter>
3542
</activity>
43+
44+
<activity
45+
android:name=".activities.ShowFeature"
46+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
47+
android:label="@string/app_name"
48+
android:launchMode="singleTask" >
49+
50+
</activity>
51+
<activity
52+
android:name=".activities.ChatBoxFeature"
53+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
54+
android:label="@string/app_name"
55+
android:launchMode="singleTask" >
56+
57+
</activity>
58+
59+
<activity
60+
android:name=".activities.StreamPicker"
61+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
62+
android:label="@string/app_name"
63+
android:launchMode="singleTask" >
64+
65+
</activity>
3666
<activity
3767
android:name=".activities.LoginActivity"
3868
android:label="@string/app_name"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
package com.zulip.android.activities;
2+
3+
4+
/**
5+
* Created by Minarva on 12-10-16.
6+
*/
7+
import android.app.ExpandableListActivity;
8+
import android.content.Intent;
9+
import android.content.res.Resources;
10+
import android.graphics.Paint;
11+
import android.os.Bundle;
12+
import android.support.v7.app.AppCompatActivity;
13+
import android.text.TextPaint;
14+
import android.view.View;
15+
import android.widget.Button;
16+
import android.widget.TextView;
17+
18+
import com.zulip.android.R;
19+
import com.github.amlcurran.showcaseview.ShowcaseView;
20+
import com.github.amlcurran.showcaseview.targets.ViewTarget;
21+
22+
public class ChatBoxFeature extends AppCompatActivity {
23+
ShowcaseView showcaseView;
24+
TextView body;
25+
int flag;
26+
@Override
27+
protected void onCreate(Bundle savedInstanceState) {
28+
super.onCreate(savedInstanceState);
29+
setContentView(R.layout.chat_box_feature);
30+
final Button startButton = (Button)findViewById(R.id.button);
31+
final TextPaint titlePaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
32+
titlePaint.setTextSize(44.0f);
33+
34+
showcaseView = new ShowcaseView.Builder(this)
35+
.withNewStyleShowcase()
36+
.setTarget(new ViewTarget(R.id.chatbox, this))
37+
.setContentTitle("Swipe left or right to remove the chat box")
38+
.setStyle(R.style.CustomShowcaseTheme2)
39+
.build();
40+
flag = 0;
41+
body = (TextView)findViewById(R.id.switch_stream);
42+
startButton.setOnClickListener(new View.OnClickListener() {
43+
@Override
44+
public void onClick(View v) {
45+
if(flag == 0) {
46+
showcaseView = new ShowcaseView.Builder(ChatBoxFeature.this)
47+
.withNewStyleShowcase()
48+
.setTarget(new ViewTarget(R.id.switch_stream, ChatBoxFeature.this)).setContentTitlePaint(titlePaint)
49+
.setContentTitle("Press here to choose a stream")
50+
.setStyle(R.style.CustomShowcaseTheme2)
51+
.build();
52+
showcaseView.show();
53+
flag = 1;
54+
55+
}else{
56+
Intent i = new Intent(ChatBoxFeature.this, StreamPicker.class);
57+
startActivity(i);
58+
}
59+
60+
}
61+
});
62+
}
63+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package com.zulip.android.activities;
2+
3+
/**
4+
* Created by Minarva on 11-10-16.
5+
*/
6+
import android.app.ExpandableListActivity;
7+
import android.content.Intent;
8+
import android.content.res.Resources;
9+
import android.graphics.Paint;
10+
import android.os.Bundle;
11+
import android.support.v7.app.AppCompatActivity;
12+
import android.text.TextPaint;
13+
import android.view.View;
14+
import android.widget.Button;
15+
import android.widget.TextView;
16+
17+
import com.zulip.android.R;
18+
import com.github.amlcurran.showcaseview.ShowcaseView;
19+
import com.github.amlcurran.showcaseview.targets.ViewTarget;
20+
21+
public class MessageExplain extends AppCompatActivity {
22+
ShowcaseView showcaseView;
23+
TextView body;
24+
int flag;
25+
@Override
26+
protected void onCreate(Bundle savedInstanceState) {
27+
super.onCreate(savedInstanceState);
28+
setContentView(R.layout.message_explain);
29+
final Button startButton = (Button)findViewById(R.id.start_button);
30+
final TextPaint titlePaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
31+
titlePaint.setTextSize(44.0f);
32+
33+
showcaseView = new ShowcaseView.Builder(this)
34+
.withNewStyleShowcase()
35+
.setTarget(new ViewTarget(R.id.more_options, this))
36+
.setContentTitle("Long press on the Message to get more options")
37+
.setStyle(R.style.CustomShowcaseTheme2)
38+
.build();
39+
flag = 0;
40+
body = (TextView)findViewById(R.id.more_options);
41+
startButton.setOnClickListener(new View.OnClickListener() {
42+
@Override
43+
public void onClick(View v) {
44+
Intent i = new Intent(MessageExplain.this, ShowFeature.class);
45+
startActivity(i);
46+
47+
}
48+
});
49+
}
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package com.zulip.android.activities;
2+
3+
/**
4+
* Created by Minarva on 11-10-16.
5+
*/
6+
import android.app.ExpandableListActivity;
7+
import android.content.ActivityNotFoundException;
8+
import android.content.Intent;
9+
import android.content.res.Resources;
10+
import android.graphics.Paint;
11+
import android.net.Uri;
12+
import android.os.Bundle;
13+
import android.support.v7.app.AppCompatActivity;
14+
import android.text.TextPaint;
15+
import android.view.View;
16+
import android.widget.Button;
17+
import android.widget.TextView;
18+
19+
import com.zulip.android.R;
20+
import com.github.amlcurran.showcaseview.ShowcaseView;
21+
import com.github.amlcurran.showcaseview.targets.ViewTarget;
22+
23+
public class ShowFeature extends AppCompatActivity {
24+
ShowcaseView showcaseView;
25+
int flag;
26+
27+
@Override
28+
protected void onCreate(Bundle savedInstanceState) {
29+
super.onCreate(savedInstanceState);
30+
setContentView(R.layout.show_feature);
31+
showcaseView = new ShowcaseView.Builder(this)
32+
.withNewStyleShowcase()
33+
.setTarget(new ViewTarget(R.id.results, this))
34+
.setContentTitle("Swipe to the Left")
35+
.setContentText("Find users' online status and start private chat")
36+
.setStyle(R.style.CustomShowcaseTheme2)
37+
.build();
38+
39+
flag = 0;
40+
final Button startButton = (Button)findViewById(R.id.button);
41+
42+
startButton.setOnClickListener(new View.OnClickListener() {
43+
@Override
44+
public void onClick(View v) {
45+
{
46+
47+
Intent i = new Intent(ShowFeature.this, ChatBoxFeature.class);
48+
startActivity(i);
49+
}
50+
51+
}
52+
});
53+
}
54+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package com.zulip.android.activities;
2+
3+
/**
4+
* Created by Minarva on 11-10-16.
5+
*/
6+
import android.app.ExpandableListActivity;
7+
import android.content.ActivityNotFoundException;
8+
import android.content.Intent;
9+
import android.content.res.Resources;
10+
import android.graphics.Paint;
11+
import android.net.Uri;
12+
import android.os.Bundle;
13+
import android.support.v7.app.AppCompatActivity;
14+
import android.text.TextPaint;
15+
import android.view.View;
16+
import android.widget.Button;
17+
import android.widget.TextView;
18+
19+
import com.zulip.android.R;
20+
import com.github.amlcurran.showcaseview.ShowcaseView;
21+
import com.github.amlcurran.showcaseview.targets.ViewTarget;
22+
23+
public class StreamPicker extends AppCompatActivity {
24+
ShowcaseView showcaseView;
25+
26+
27+
@Override
28+
protected void onCreate(Bundle savedInstanceState) {
29+
super.onCreate(savedInstanceState);
30+
setContentView(R.layout.stream_picker);
31+
showcaseView = new ShowcaseView.Builder(this)
32+
.withNewStyleShowcase()
33+
.setTarget(new ViewTarget(R.id.results, this))
34+
.setContentText("Switch to a stream and start a chat")
35+
.setStyle(R.style.CustomShowcaseTheme2)
36+
.build();
37+
38+
39+
final Button startButton = (Button)findViewById(R.id.button);
40+
41+
startButton.setOnClickListener(new View.OnClickListener() {
42+
@Override
43+
public void onClick(View v) {
44+
{
45+
46+
Intent i = new Intent(StreamPicker.this, ZulipActivity.class);
47+
startActivity(i);
48+
}
49+
50+
}
51+
});
52+
}
53+
}
115 KB
Loading
95.6 KB
Loading

app/src/main/res/drawable/chatbox.png

124 KB
Loading
6.87 KB
Loading
4.58 KB
Loading
74.5 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:orientation="vertical" android:layout_width="match_parent"
4+
android:layout_height="match_parent">
5+
<ImageView
6+
android:layout_width="match_parent"
7+
android:layout_height="match_parent"
8+
android:src="@drawable/chatbox"
9+
android:layout_alignParentRight="true"
10+
android:layout_alignParentEnd="true"
11+
android:layout_above="@+id/button"
12+
android:id="@+id/imageView3" />
13+
<ImageView
14+
android:layout_width="match_parent"
15+
android:layout_height="match_parent"
16+
android:src="@drawable/dragleftright"
17+
android:layout_alignParentBottom="true"
18+
android:layout_toEndOf="@+id/chatbox"
19+
android:layout_alignTop="@+id/chatbox"
20+
android:layout_toRightOf="@+id/chatbox" />
21+
22+
<TextView
23+
android:layout_width="150dp"
24+
android:layout_height="100dp"
25+
android:id="@+id/chatbox"
26+
android:layout_above="@+id/button"
27+
android:layout_alignRight="@+id/button"
28+
android:layout_alignEnd="@+id/button" />
29+
30+
<TextView
31+
android:layout_width="150dp"
32+
android:layout_height="100dp"
33+
android:id="@+id/switch_stream"
34+
android:layout_alignParentTop="true"
35+
android:layout_toLeftOf="@+id/button"
36+
android:layout_toStartOf="@+id/button" />
37+
38+
<Button
39+
android:layout_width="wrap_content"
40+
android:layout_height="wrap_content"
41+
android:text="Continue"
42+
android:id="@+id/button"
43+
android:layout_alignParentBottom="true"
44+
android:layout_centerHorizontal="true" />
45+
46+
</RelativeLayout>

0 commit comments

Comments
 (0)