Skip to content
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
4 changes: 2 additions & 2 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
</content>
<orderEntry type="jdk" jdkName="Android API 28 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Gradle: __local_aars__:/Users/davidheimann/Documents/git/streaming-android/app/libs/red5streaming.jar:unspecified@jar" level="project" />
<orderEntry type="library" name="Gradle: __local_aars__:/Users/toddanderson/Documents/workspace/red5pro/streaming-android/app/libs/red5streaming.jar:unspecified@jar" level="project" />
<orderEntry type="library" name="Gradle: ch.qos.logback:logback-classic:1.2.3@jar" level="project" />
<orderEntry type="library" name="Gradle: ch.qos.logback:logback-core:1.2.3@jar" level="project" />
<orderEntry type="library" name="Gradle: org.apache.mina:mina-core:2.1.3@jar" level="project" />
Expand Down Expand Up @@ -127,4 +127,4 @@
<orderEntry type="library" name="Gradle: android.arch.core:runtime:1.1.1@aar" level="project" />
<orderEntry type="library" name="Gradle: org.apache.http.legacy-android-28" level="project" />
</component>
</module>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import android.widget.ListView;

import red5pro.org.testandroidproject.tests.TestContent;
import red5pro.org.testandroidproject.tests.TestItemAdapter;

/**
* A list fragment representing a list of Tests. This fragment
Expand Down Expand Up @@ -101,12 +102,13 @@ public void onCreate(Bundle savedInstanceState) {
//Load XML TESTS
TestContent.LoadTests(res.openRawResource(R.raw.tests));
// TODO: replace with a real list adapter.
// AND DONE! see onViewCreated

setListAdapter(new ArrayAdapter<TestContent.TestItem>(
getActivity(),
android.R.layout.simple_list_item_activated_1,
android.R.id.text1,
TestContent.ITEMS));
// setListAdapter(new ArrayAdapter<TestContent.TestItem>(
// getActivity(),
// android.R.layout.simple_list_item_activated_1,
// android.R.id.text1,
// TestContent.ITEMS));
}

@Override
Expand All @@ -118,6 +120,10 @@ public void onViewCreated(View view, Bundle savedInstanceState) {
&& savedInstanceState.containsKey(STATE_ACTIVATED_POSITION)) {
setActivatedPosition(savedInstanceState.getInt(STATE_ACTIVATED_POSITION));
}

// Added to be able to assign accessibility id for appium testing.
TestItemAdapter adapter = new TestItemAdapter(this.getActivity(), TestContent.ITEMS);
setListAdapter(adapter);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
//
// Copyright © 2015 Infrared5, Inc. All rights reserved.
//
// The accompanying code comprising examples for use solely in conjunction with Red5 Pro (the "Example Code")
// is licensed to you by Infrared5 Inc. in consideration of your agreement to the following
// license terms and conditions. Access, use, modification, or redistribution of the accompanying
// code constitutes your acceptance of the following license terms and conditions.
//
// Permission is hereby granted, free of charge, to you to use the Example Code and associated documentation
// files (collectively, the "Software") without restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The Software shall be used solely in conjunction with Red5 Pro. Red5 Pro is licensed under a separate end
// user license agreement (the "EULA"), which must be executed with Infrared5, Inc.
// An example of the EULA can be found on our website at: https://account.red5pro.com/assets/LICENSE.txt.
//
// The above copyright notice and this license shall be included in all copies or portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL INFRARED5, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
package red5pro.org.testandroidproject.tests.PublishCameraSwapBlinkTest;

import android.hardware.Camera;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
package red5pro.org.testandroidproject.tests;


import android.content.Context;
import android.util.Log;
import android.widget.ArrayAdapter;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
Expand Down Expand Up @@ -75,7 +78,7 @@ public static void LoadTests(InputStream stream){
NodeList tests = doc.getDocumentElement().getElementsByTagName("Test");
for (int i = 0; i < tests.getLength() ; i++) {
Element testElement = (Element)tests.item(i);
TestItem test = new TestItem( ""+i , testElement );//.getAttribute("title") , testElement.toString() );
TestItem test = new TestItem(""+i , testElement );//.getAttribute("title") , testElement.toString() );
ITEMS.add( test );
}

Expand Down Expand Up @@ -163,6 +166,7 @@ public static void SetTestItem( int id ) {

public static class TestItem {
public String id;
public String title;
public String content;
public String className;
public String description;
Expand All @@ -176,6 +180,7 @@ public TestItem( String _id, String _content) {

public TestItem( String _id, Element contentXML) {
id = _id;
title = contentXML.getAttribute("title");
content = contentXML.getElementsByTagName("name").item(0).getTextContent();
className = contentXML.getElementsByTagName("class").item(0).getTextContent();
description = contentXML.getElementsByTagName("description").item(0).getTextContent();
Expand All @@ -187,4 +192,5 @@ public String toString() {
return content;
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
//
// Copyright © 2015 Infrared5, Inc. All rights reserved.
//
// The accompanying code comprising examples for use solely in conjunction with Red5 Pro (the "Example Code")
// is licensed to you by Infrared5 Inc. in consideration of your agreement to the following
// license terms and conditions. Access, use, modification, or redistribution of the accompanying
// code constitutes your acceptance of the following license terms and conditions.
//
// Permission is hereby granted, free of charge, to you to use the Example Code and associated documentation
// files (collectively, the "Software") without restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The Software shall be used solely in conjunction with Red5 Pro. Red5 Pro is licensed under a separate end
// user license agreement (the "EULA"), which must be executed with Infrared5, Inc.
// An example of the EULA can be found on our website at: https://account.red5pro.com/assets/LICENSE.txt.
//
// The above copyright notice and this license shall be included in all copies or portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL INFRARED5, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
package red5pro.org.testandroidproject.tests;

import android.content.Context;
import android.content.res.Resources;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

import red5pro.org.testandroidproject.R;

public class TestItemAdapter extends ArrayAdapter<TestContent.TestItem> {
public TestItemAdapter(Context context, List<TestContent.TestItem> tests) {
super(context, 0, tests);
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
// Get the data item for this position
TestContent.TestItem test = getItem(position);
// Check if an existing view is being reused, otherwise inflate the view
if (convertView == null) {
convertView = LayoutInflater.from(getContext()).inflate(R.layout.test_list_item, parent, false);
}
// Lookup view for data population
// TextView title = (TextView) convertView.findViewWithTag("textfield");
TextView title = (TextView) convertView.findViewById(R.id.txt);
// Populate the data into the template view using the data object
title.setText(test.content);
title.setContentDescription(test.title);
Resources res = title.getResources();
// Return the completed view to render on screen
return convertView;
}
}
11 changes: 11 additions & 0 deletions app/src/main/res/layout/test_list_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:gravity="center_vertical"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:background="?android:attr/activatedBackgroundIndicator"
android:minHeight="?android:attr/listPreferredItemHeightSmall" />