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

Add tutorial sliders for first time launch of app #466

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add tutorial sliders for first time launch of app #466

wants to merge 1 commit into from

Conversation

saketkumar
Copy link
Collaborator

Summary of changes

Fixes https://github.com/zulip/zulip-android/issues/161

Please make sure these boxes are checked before submitting your pull request - thanks! Guide

  • Code is formatted.

  • Run the lint tests with ./gradlew lintDebug and make sure BUILD is SUCCESSFUL

  • If new feature is implemeted then it is compatible with Night theme too.

  • Commit messages are well-written.

Copy link
Member

@jainkuniya jainkuniya left a comment

Choose a reason for hiding this comment

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

Instead of creating 4 different layout's you can create one base fragment class and it's corresponding base layout. Then create 4 different instance of this base fragment with different image and description. This might be helpful http://stackoverflow.com/questions/27371565/use-same-fragment-in-viewpager-but-fragment-will-have-different-layout-each-time

@saketkumar
Copy link
Collaborator Author

@vishwesh3 yeah i tried same the first time but all layouts have different sizes and of imagview and paddings so it is difficult to have same dimensions in all the 4 layouts

@nitish1211
Copy link
Collaborator

nitish1211 commented Mar 12, 2017

@saketkumar95 How about using the App intro Library Material AppIntro?
Both look the same but It would cut down on the lines of code. :)

@saketkumar
Copy link
Collaborator Author

@nitish1211 The library looks awesome but we are using simple intro slides and i just used 1 class and 4 layouts so it doesn't make sense for using library for that only. We already have lots of library and apk size is already high right now. :)

@meghalagrawal
Copy link
Collaborator

Anyone Working on this ?

I want to work on ViewPager and add Multiple instances of Fragment instead of 4 Different Layouts.

@Sam1301
Copy link
Member

Sam1301 commented Mar 27, 2017

@saketkumar95 thanks for working on this! 👍

One issue: I noticed the shadow under the toolbar and menu in zulipActivity are lost.

Copy link
Member

@Sam1301 Sam1301 left a comment

Choose a reason for hiding this comment

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

@saketkumar95 nice work 👍 Posted some comments.

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
Copy link
Member

Choose a reason for hiding this comment

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

okay so the tutorial_slide 1 to 4 are very similar, except the fact that the views point to different resources.
I suggest we just use a single .xml file and customise it for different slides. This would reduce the number of lines of code significantly.

<Button
android:id="@+id/btn_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Copy link
Member

Choose a reason for hiding this comment

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

we can abstract out the style of buttons here into styles.xml

android:gravity="center"
android:orientation="horizontal">


Copy link
Member

Choose a reason for hiding this comment

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

there are some extra newlines in other xml files as well

<LinearLayout
android:id="@+id/layoutDots"
android:layout_width="match_parent"
android:layout_height="30dp"
Copy link
Member

Choose a reason for hiding this comment

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

how about saving dimensions in dimen.xml?

}

public void setFirstTimeLaunch(boolean isFirstTime) {
editor.putBoolean(IS_FIRST_TIME_LAUNCH, isFirstTime);
Copy link
Member

Choose a reason for hiding this comment

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

how about saving the version of app instead of a boolean; shared pref will remain same across upgrades

private static final String IS_FIRST_TIME_LAUNCH = "IsFirstTimeLaunch";
SharedPreferences pref;
SharedPreferences.Editor editor;
Context _context;
Copy link
Member

Choose a reason for hiding this comment

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

Non-public, non-static field names start with m.

@@ -32,6 +32,8 @@
android:allowBackup="false"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:hardwareAccelerated="false"
android:largeHeap="true"
Copy link
Member

Choose a reason for hiding this comment

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

what is the story behind this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Sam1301 There was an issue outOfMemory error with loading the images. So i added largeheap to optimize using memory. :)


<item
android:id="@+id/helpMe"
android:title="Help" />
Copy link
Member

Choose a reason for hiding this comment

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

hardcoded string; also maybe calling it "Tutorial" or "Take a tour" would be better?

@kunall17
Copy link
Collaborator

kunall17 commented Apr 8, 2017

@saketkumar95 I would want to merge this, can you fix the comments posted by saumya?

@saketkumar
Copy link
Collaborator Author

@kunall17 Yeah i will do this in 1-2 days, currently busy in my lab exams. :/

@zulipbot
Copy link
Member

zulipbot commented May 4, 2017

@saketkumar95, your pull request has developed a merge conflict! Please review the most recent commit (f791888) for conflicting changes and resolve your pull request's merge conflicts.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants