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

Android streams implementation #41

Merged
merged 43 commits into from
Feb 16, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ca40fee
Refactor model data into seperate package and refactor previous model…
kylelwm Jan 29, 2016
da8e6c4
Fix Logout and remove TitleBar in Welcome screen
kylelwm Jan 30, 2016
f7925ca
Added default constructor to instantiate WorldScopeUser
kylelwm Jan 30, 2016
c3788ec
Updated XML layout and remove redundant fragments
kylelwm Jan 30, 2016
ddae3fc
Set up SwipeRefreshLayout, hook up to ListView and setup dummy data i…
kylelwm Jan 30, 2016
b81ab0d
Updated method to instantiate Retrofit, created new API call getStrea…
kylelwm Jan 30, 2016
69d8e6b
Included toString() methods for WorldScopeStream and WorldScopeViewSt…
kylelwm Jan 30, 2016
9edf577
Increase cache limit of tabs from 2 to 3
kylelwm Feb 2, 2016
85d66dd
Remove putFakeData() and add real data to streams, modified model to …
kylelwm Feb 2, 2016
35a5f41
Remove GIF player dependency because it cause regression with JavaCV
kylelwm Feb 8, 2016
9edd95e
Refactor and reorder Gradle dependencies
kylelwm Feb 8, 2016
392dcec
Reimplemented playing of GIF to use webview instead of regression lib…
kylelwm Feb 8, 2016
f54985d
Added minimizing of app when back button is pressed in MainActivity
kylelwm Feb 8, 2016
05f125c
Refactor FacebookLoginActivity's redirection to MainActivity to a method
kylelwm Feb 9, 2016
f3f0c70
Account for case where no user is loaded into MainActivity
kylelwm Feb 9, 2016
72dcf88
Set up Android Instrumentation test environment for project
kylelwm Feb 9, 2016
a7b580c
Remove stub test and add tests for redirections
kylelwm Feb 9, 2016
f9c0549
Updated JavaCV version
kylelwm Feb 11, 2016
837f280
Refactored streaming functionality of StreamActivity into a fragment …
kylelwm Feb 11, 2016
f8555f1
Changed theme of StreamActivity to fullscreen and allow opening of so…
kylelwm Feb 11, 2016
7bf0a98
Edited streamVideoFragment to add preview only to its own View
kylelwm Feb 11, 2016
6dd2939
Created new Fragment that takes care of creating streams and is displ…
kylelwm Feb 11, 2016
9a03e55
Implemented the callback for the new StreamCreateFragment
kylelwm Feb 11, 2016
f1a267e
Remove misc Todos
kylelwm Feb 12, 2016
5d0ebb3
Added permission for Vibration
kylelwm Feb 12, 2016
b2b5ef9
Created new themes to support the StreamActivity requirements
kylelwm Feb 12, 2016
12546d8
Refactored StreamActivity to act as a central hub for various fragmen…
kylelwm Feb 12, 2016
8e68ec7
Included fragments into the stream activity UI
kylelwm Feb 12, 2016
993e9f0
Fragment in charge of creating and stopping streams, also include UI …
kylelwm Feb 12, 2016
841a7ed
Removed old stream controls template and added new fragment for actua…
kylelwm Feb 12, 2016
3930f5b
Created new API end point for creating a stream
kylelwm Feb 12, 2016
8d04eff
Refactor Date to a String for compatibility purposes
kylelwm Feb 12, 2016
6dd20d1
Imported icon resources for Record button
kylelwm Feb 12, 2016
9d572d8
Created new StreamVideoControl fragment that handles user interventio…
kylelwm Feb 12, 2016
ef34bc9
Added logging for DashRendererBuilder
kylelwm Feb 14, 2016
ed2fe31
Shorten success message for streaming
kylelwm Feb 14, 2016
b121f25
Integrate clicking of stream to redirect into ViewActivity
kylelwm Feb 14, 2016
37f6663
Make WorldScopeViewStream and WorldScopeStream parcelable so that it …
kylelwm Feb 14, 2016
0bd8aca
Fix comments in StreamRefreshListFragment and added Pretty Time libra…
kylelwm Feb 16, 2016
67a1e71
Fix audio rate when streaming
kylelwm Feb 16, 2016
8de2c0b
Fix null object reference error when App server is down
kylelwm Feb 16, 2016
03b0826
Fix model to reflect correct date parsing
kylelwm Feb 16, 2016
11b722c
Remove additional imports
kylelwm Feb 16, 2016
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
Prev Previous commit
Next Next commit
Created new Fragment that takes care of creating streams and is displ…
…ayed on top of the preview
  • Loading branch information
kylelwm committed Feb 16, 2016
commit 6dd2939f31092cfc4e9ff08826396925cfbba7c3
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
package com.litmus.worldscope;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;


/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* {@link StreamCreateFragment.OnStreamCreateFragmentListener} interface
* to handle interaction events.
* Use the {@link StreamCreateFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class StreamCreateFragment extends Fragment {

private OnStreamCreateFragmentListener listener;

public StreamCreateFragment() {
// Required empty public constructor
}

/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @return A new instance of fragment StreamCreateFragment.
*/
// TODO: Rename and change types and number of parameters
public static StreamCreateFragment newInstance() {
StreamCreateFragment fragment = new StreamCreateFragment();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_stream_create, container, false);

view.findViewById(R.id.cancelStreamButton).setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
listener.onCancelStreamButtonClicked();
}
});
return view;
}

@Override
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof OnStreamCreateFragmentListener) {
listener = (OnStreamCreateFragmentListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnFragmentInteractionListener");
}
}

@Override
public void onDetach() {
super.onDetach();
listener = null;
}

/**
* This interface must be implemented by activities that contain this
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p/>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
*/
public interface OnStreamCreateFragmentListener {
// Implement to receive update upon stream creation success
void onStreamCreationSuccess(String rtmpLink);

// Implement to handle CancelStreamButton
void onCancelStreamButtonClicked();

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:context="com.litmus.worldscope.StreamCreateFragment"
android:background="#64000000">

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Create your stream"
android:id="@+id/textView"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:textColor="#ffffff"
android:layout_alignParentStart="true"
android:textAlignment="center" />

<android.support.design.widget.TextInputLayout
android:id="@+id/titleWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColorHint="#FFE0E0E0">

<EditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textCapSentences"
android:hint="Title"
android:textColor="#ffffff"/>

</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
android:id="@+id/descriptionWrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColorHint="#FFE0E0E0">

<EditText
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:hint="Write a description"
android:layout_gravity="center"
android:textColor="#ffffff"/>

</android.support.design.widget.TextInputLayout>

</LinearLayout>

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="false">
<Button
android:id="@+id/createStreamButton"
style="?android:attr/borderlessButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_below="@+id/button"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:text="Stream"
android:layout_weight="1"
android:background="#EB8A3A"
android:textColor="#FFFFFF" />


<Button
android:id="@+id/cancelStreamButton"
style="?android:attr/borderlessButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_below="@+id/button"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:text="Cancel"
android:layout_weight="1"
android:textColor="#ffffff"
android:onClick="cancelStream"/>
</LinearLayout>


</RelativeLayout>

</FrameLayout>