Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Commit

Permalink
Merge pull request #97 from vase4kin/dev
Browse files Browse the repository at this point in the history
Release 1.2.4
  • Loading branch information
vase4kin authored Aug 31, 2017
2 parents 18d380d + 1982135 commit 13dea78
Show file tree
Hide file tree
Showing 54 changed files with 1,167 additions and 199 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![License](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![Circle CI](https://circleci.com/gh/vase4kin/TeamCityApp/tree/master.svg?style=shield)](https://circleci.com/gh/vase4kin/TeamCityApp/tree/master)
[![codecov](https://codecov.io/gh/vase4kin/TeamCityApp/branch/master/graph/badge.svg)](https://codecov.io/gh/vase4kin/TeamCityApp)

[![Release](https://img.shields.io/badge/release-1.2.3-blue.svg)](https://github.com/vase4kin/TeamCityApp/releases/latest)
```
* ) ( ) (
Expand Down
5 changes: 3 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ android {
applicationId "com.github.vase4kin.teamcityapp"
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
versionCode 33
versionName "1.2.3"
versionCode rootProject.versionCode
versionName rootProject.versionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
Expand Down Expand Up @@ -179,6 +179,7 @@ dependencies {
compile('com.mikepenz:aboutlibraries:5.9.7@aar') {
transitive = true
}
compile 'com.github.daniel-stoneuk:material-about-library:2.2.1'
// Onboarding
compile 'uk.co.samuelwall:material-tap-target-prompt:2.0.0'
// Dagger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import com.github.vase4kin.teamcityapp.R;
import com.github.vase4kin.teamcityapp.TeamCityApplication;
import com.github.vase4kin.teamcityapp.dagger.components.AppComponent;
import com.github.vase4kin.teamcityapp.dagger.components.RestApiComponent;
Expand All @@ -35,10 +36,10 @@
import static com.github.vase4kin.teamcityapp.helper.TestUtils.matchToolbarTitle;

/**
* Tests for {@link AboutActivity}
* Tests for {@link AboutLibrariesActivity}
*/
@RunWith(AndroidJUnit4.class)
public class AboutActivityTest {
public class AboutLibrariesActivityTest {

private static final String URL = "http://teamcity.server.com";

Expand All @@ -54,11 +55,12 @@ public void setComponent(RestApiComponent restApiComponent) {
});

@Rule
public CustomActivityTestRule<AboutActivity> mActivityTestRule = new CustomActivityTestRule<>(AboutActivity.class);
public CustomActivityTestRule<AboutLibrariesActivity> mActivityTestRule = new CustomActivityTestRule<>(AboutLibrariesActivity.class);

@Test
public void testAboutActivity() throws Exception {
mActivityTestRule.launchActivity(null);
matchToolbarTitle("About");
String toolbarTitle = mActivityTestRule.getActivity().getString(R.string.about_app_text_libraries);
matchToolbarTitle(toolbarTitle);
}
}
10 changes: 6 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.vase4kin.teamcityapp">

Expand All @@ -26,8 +25,8 @@
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/AppTheme">
<activity
android:name=".splash.view.SplashActivity"
Expand Down Expand Up @@ -76,15 +75,18 @@
android:label="@string/title_activity_create_account" />
<activity android:name=".testdetails.view.TestDetailsActivity" />
<activity
android:name=".about.AboutActivity"
android:label="@string/about_drawer_item"
android:name=".about.AboutLibrariesActivity"
android:label="@string/title_activity_about_libraries"
android:launchMode="singleTop" />
<activity
android:name=".runbuild.view.RunBuildActivity"
android:label="@string/title_run_build" />
<activity
android:name=".filter_builds.view.FilterBuildsActivity"
android:label="@string/title_filter_builds" />
<activity
android:name=".about.AboutActivity"
android:label="@string/about_drawer_item" />

<provider
android:name="android.support.v4.content.FileProvider"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;

import com.github.vase4kin.teamcityapp.R;
Expand All @@ -32,12 +31,11 @@
import com.github.vase4kin.teamcityapp.drawer.tracker.DrawerTracker;
import com.github.vase4kin.teamcityapp.drawer.utils.DrawerActivityStartUtils;
import com.github.vase4kin.teamcityapp.drawer.view.DrawerView;
import com.mikepenz.aboutlibraries.LibsBuilder;

import javax.inject.Inject;

/**
* About screen activity
* About activity
*/
public class AboutActivity extends AppCompatActivity {

Expand All @@ -58,18 +56,10 @@ protected void onCreate(Bundle savedInstanceState) {

mDrawerPresenter.onCreate();

// About library fragment
Fragment aboutLibrary = new LibsBuilder()
.withAboutIconShown(true)
.withAboutVersionShown(true)
.withLicenseShown(true)
.withAboutDescription(getString(R.string.about_app_description))
.supportFragment();

// Commit fragment to container
getSupportFragmentManager()
.beginTransaction()
.add(R.id.about_library_container, aboutLibrary)
.add(R.id.about_library_container, new AboutFragment())
.addToBackStack(null)
.commit();
}
Expand All @@ -87,4 +77,5 @@ public static void start(Activity activity) {
.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
DrawerActivityStartUtils.startActivity(launchIntent, activity);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
/*
* Copyright 2016 Andrey Tolpeev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.github.vase4kin.teamcityapp.about;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

import com.danielstone.materialaboutlibrary.ConvenienceBuilder;
import com.danielstone.materialaboutlibrary.MaterialAboutFragment;
import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem;
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction;
import com.danielstone.materialaboutlibrary.model.MaterialAboutCard;
import com.danielstone.materialaboutlibrary.model.MaterialAboutList;
import com.github.vase4kin.teamcityapp.BuildConfig;
import com.github.vase4kin.teamcityapp.R;
import com.joanzapata.iconify.IconDrawable;
import com.joanzapata.iconify.fonts.MaterialCommunityIcons;
import com.joanzapata.iconify.fonts.MaterialIcons;

public class AboutFragment extends MaterialAboutFragment {

@Override
protected MaterialAboutList getMaterialAboutList(final Context context) {
MaterialAboutCard.Builder appCardBuilder = new MaterialAboutCard.Builder();
appCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(getString(R.string.version))
.icon(new IconDrawable(context, MaterialIcons.md_info_outline).colorRes(R.color.sub_text_color).sizeDp(24))
.subText(BuildConfig.VERSION_NAME)
.build())
.addItem(ConvenienceBuilder.createRateActionItem(context, new IconDrawable(context, MaterialIcons.md_star_border).colorRes(R.color.sub_text_color).sizeDp(24),
getString(R.string.about_app_text_rate_app), null))
.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.about_app_text_found_issue)
.subText(R.string.about_app_subtext_found_issue)
.icon(new IconDrawable(context, MaterialIcons.md_question_answer).colorRes(R.color.sub_text_color).sizeDp(24))
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(getString(R.string.about_app_url_found_issue)));
getActivity().startActivity(intent);

}
})
.build());

MaterialAboutCard.Builder miscCardBuilder = new MaterialAboutCard.Builder();
miscCardBuilder
.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.about_app_text_source_code)
.icon(new IconDrawable(context, MaterialCommunityIcons.mdi_github_circle).colorRes(R.color.sub_text_color).sizeDp(24))
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(getString(R.string.about_app_url_source_code)));
getActivity().startActivity(intent);
}
})
.build())
.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.about_app_text_libraries)
.icon(new IconDrawable(context, MaterialCommunityIcons.mdi_github_circle).colorRes(R.color.sub_text_color).sizeDp(24))
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
AboutLibrariesActivity.start(getActivity());
}
})
.build());

MaterialAboutCard.Builder authorCardBuilder = new MaterialAboutCard.Builder();
authorCardBuilder.title(R.string.about_app_text_contacts);
authorCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.about_app_text_github)
.icon(new IconDrawable(context, MaterialCommunityIcons.mdi_github_circle).colorRes(R.color.sub_text_color).sizeDp(24))
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(getString(R.string.about_app_url_github)));
getActivity().startActivity(intent);

}
})
.build())
.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.about_app_text_telegram)
.icon(new IconDrawable(context, MaterialCommunityIcons.mdi_telegram).colorRes(R.color.sub_text_color).sizeDp(24))
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(getString(R.string.about_app_url_telegram)));
getActivity().startActivity(intent);
}
})
.build())
.addItem(ConvenienceBuilder.createEmailItem(context, new IconDrawable(context, MaterialIcons.md_email).colorRes(R.color.sub_text_color).sizeDp(24),
getText(R.string.about_app_text_email), true, getString(R.string.about_app_email), getString(R.string.about_app_email_title)));

return new MaterialAboutList(appCardBuilder.build(), miscCardBuilder.build(), authorCardBuilder.build());
}

@Override
protected int getTheme() {
return R.style.AppTheme_MaterialAboutActivity_Fragment;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* Copyright 2016 Andrey Tolpeev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.github.vase4kin.teamcityapp.about;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;

import com.github.vase4kin.teamcityapp.R;
import com.github.vase4kin.teamcityapp.TeamCityApplication;
import com.github.vase4kin.teamcityapp.about.dagger.DaggerAboutPageComponent;
import com.github.vase4kin.teamcityapp.drawer.dagger.DrawerModule;
import com.github.vase4kin.teamcityapp.drawer.data.DrawerDataManager;
import com.github.vase4kin.teamcityapp.drawer.presenter.DrawerPresenterImpl;
import com.github.vase4kin.teamcityapp.drawer.router.DrawerRouter;
import com.github.vase4kin.teamcityapp.drawer.tracker.DrawerTracker;
import com.github.vase4kin.teamcityapp.drawer.utils.DrawerActivityStartUtils;
import com.github.vase4kin.teamcityapp.drawer.view.DrawerView;
import com.mikepenz.aboutlibraries.LibsBuilder;

import javax.inject.Inject;

/**
* About libraries screen activity
*/
public class AboutLibrariesActivity extends AppCompatActivity {

@Inject
DrawerPresenterImpl<DrawerView, DrawerDataManager, DrawerRouter, DrawerTracker> mDrawerPresenter;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);

// Injecting DrawerPresenterImpl to activity
DaggerAboutPageComponent.builder()
.drawerModule(new DrawerModule(this, true, DrawerView.ABOUT))
.restApiComponent(((TeamCityApplication) getApplication()).getRestApiInjector())
.build()
.inject(this);

mDrawerPresenter.onCreate();

// About library fragment
Fragment aboutLibrary = new LibsBuilder()
.supportFragment();

// Commit fragment to container
getSupportFragmentManager()
.beginTransaction()
.add(R.id.about_library_container, aboutLibrary)
.addToBackStack(null)
.commit();
}

@Override
public void onBackPressed() {
mDrawerPresenter.onBackButtonPressed();
}

/**
* Start About activity with Flag {@link Intent#FLAG_ACTIVITY_SINGLE_TOP}
*/
public static void start(Activity activity) {
Intent launchIntent = new Intent(activity, AboutLibrariesActivity.class)
.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
DrawerActivityStartUtils.startActivity(launchIntent, activity);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.github.vase4kin.teamcityapp.about.dagger;

import com.github.vase4kin.teamcityapp.about.AboutActivity;
import com.github.vase4kin.teamcityapp.about.AboutLibrariesActivity;
import com.github.vase4kin.teamcityapp.dagger.components.RestApiComponent;
import com.github.vase4kin.teamcityapp.dagger.scopes.PresenterScope;
import com.github.vase4kin.teamcityapp.drawer.dagger.DrawerModule;
Expand All @@ -27,5 +28,7 @@
@Component(dependencies = RestApiComponent.class, modules = DrawerModule.class)
public interface AboutPageComponent {

void inject(AboutLibrariesActivity aboutLibrariesActivity);

void inject(AboutActivity aboutActivity);
}
Loading

0 comments on commit 13dea78

Please sign in to comment.