Upgraded Gradle to version 3.1.3

This commit is contained in:
Pierre HUBERT 2018-07-30 15:17:56 +02:00
parent 56521b1106
commit b279fbbe3f
19 changed files with 137 additions and 72 deletions

View File

@ -1,12 +1,12 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
compileSdkVersion 28
defaultConfig {
applicationId "org.communiquons.android.comunic.client"
minSdkVersion 21
targetSdkVersion 26
targetSdkVersion 28
versionCode 5
versionName "1.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@ -44,12 +44,12 @@ android {
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.+'
testCompile 'junit:junit:4.12'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-beta01'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:28.0.0-beta01'
implementation 'com.android.support:support-v4:28.0.0-beta01'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

View File

@ -42,7 +42,12 @@
<!-- PDF Viewer activity -->
<activity
android:name=".ui.activities.PDFActivity"
android:label="@string/activity_view_pdf_label"/>
android:label="@string/activity_view_pdf_label" />
<!-- Settings activity -->
<activity
android:name=".ui.activities.SettingsActivity"
android:label="@string/title_activity_settings"/>
</application>
</manifest>

View File

@ -2,7 +2,7 @@ package org.communiquons.android.comunic.client.ui.activities;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.FragmentTransaction;
import android.support.v4.app.FragmentTransaction;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.AsyncTask;
@ -345,7 +345,7 @@ public class MainActivity extends AppCompatActivity implements openConversationL
void openFriendsFragment(){
FriendsListFragment friendsListFragment = new FriendsListFragment();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.main_fragment, friendsListFragment);
transaction.addToBackStack(null);
transaction.commit();
@ -353,14 +353,11 @@ public class MainActivity extends AppCompatActivity implements openConversationL
}
/**
* Open settings fragment
* Open settings activity
*/
void openSettingsFragment(){
SettingsFragment settingsFragment = new SettingsFragment();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(R.id.main_fragment, settingsFragment);
transaction.addToBackStack(null);
transaction.commit();
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
}
/**
@ -368,7 +365,7 @@ public class MainActivity extends AppCompatActivity implements openConversationL
*/
void openNotificationsFragment(){
NotificationsFragment notifications = new NotificationsFragment();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.main_fragment, notifications);
transaction.addToBackStack(null);
transaction.commit();
@ -379,7 +376,7 @@ public class MainActivity extends AppCompatActivity implements openConversationL
*/
void openUserInfosFragment(){
UserInfosFragment userInfosFragment = new UserInfosFragment();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.main_fragment, userInfosFragment);
transaction.addToBackStack(null);
transaction.commit();
@ -401,7 +398,7 @@ public class MainActivity extends AppCompatActivity implements openConversationL
UserPageFragment userPageFragment = new UserPageFragment();
userPageFragment.setArguments(args);
FragmentTransaction transaction = getFragmentManager().beginTransaction();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.main_fragment, userPageFragment);
transaction.addToBackStack(null);
transaction.commit();
@ -428,10 +425,10 @@ public class MainActivity extends AppCompatActivity implements openConversationL
//This is important in order to avoid to get the user unable to quit the page.
//Because it would get the user back to the user page fragment which would
//redirect immediately to this fragment indefinitely.
getFragmentManager().popBackStackImmediate();
getSupportFragmentManager().popBackStackImmediate();
//Perform the transition
FragmentTransaction transaction = getFragmentManager().beginTransaction();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.addToBackStack(null);
transaction.replace(R.id.main_fragment, userAccessDeniedFragment);
transaction.commit();
@ -443,7 +440,7 @@ public class MainActivity extends AppCompatActivity implements openConversationL
*/
void openConversationsListFragment(){
ConversationsListFragment conversationsListFragment = new ConversationsListFragment();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.main_fragment, conversationsListFragment);
transaction.addToBackStack(null);
transaction.commit();
@ -466,7 +463,7 @@ public class MainActivity extends AppCompatActivity implements openConversationL
conversationFragment.setArguments(args);
//Display it
FragmentTransaction transaction = getFragmentManager().beginTransaction();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.main_fragment, conversationFragment);
transaction.addToBackStack(null);
transaction.commit();
@ -521,7 +518,7 @@ public class MainActivity extends AppCompatActivity implements openConversationL
updateConversationFragment.setArguments(args);
//Display the fragment
FragmentTransaction transaction = getFragmentManager().beginTransaction();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.main_fragment, updateConversationFragment);
transaction.addToBackStack(null);
transaction.commit();
@ -539,7 +536,7 @@ public class MainActivity extends AppCompatActivity implements openConversationL
singlePostFragment.setArguments(arguments);
//Perform the transaction
FragmentTransaction transaction = getFragmentManager().beginTransaction();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.addToBackStack(null);
transaction.replace(R.id.main_fragment, singlePostFragment);
transaction.commit();
@ -554,7 +551,7 @@ public class MainActivity extends AppCompatActivity implements openConversationL
LatestPostsFragment latestPostsFragment = new LatestPostsFragment();
//Perform the transaction
FragmentTransaction transaction = getFragmentManager().beginTransaction();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.main_fragment, latestPostsFragment);
transaction.addToBackStack(null);
transaction.commit();

View File

@ -0,0 +1,50 @@
package org.communiquons.android.comunic.client.ui.activities;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import org.communiquons.android.comunic.client.R;
import org.communiquons.android.comunic.client.ui.fragments.SettingsFragment;
/**
* Settings activity
*
* This activity only proxy the settings fragments, because of I could find a valid support for
* PreferenceFragment.
*
* @author Pierre HUBERT
*/
public class SettingsActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
//Open settings view
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(R.id.fragment, new SettingsFragment());
transaction.commit();
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
// app icon in action bar clicked; goto parent activity.
this.finish();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}

View File

@ -1,7 +1,7 @@
package org.communiquons.android.comunic.client.ui.fragments;
import android.app.AlertDialog;
import android.app.Fragment;
import android.support.v4.app.Fragment;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
@ -206,13 +206,13 @@ public class ConversationFragment extends Fragment
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_conversation, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
//Main progress bar

View File

@ -1,7 +1,8 @@
package org.communiquons.android.comunic.client.ui.fragments;
import android.app.AlertDialog;
import android.app.Fragment;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.content.DialogInterface;
import android.os.AsyncTask;
import android.os.Bundle;
@ -97,12 +98,12 @@ public class ConversationsListFragment extends Fragment implements AdapterView.O
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_conversationslist, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
//Database helper

View File

@ -1,7 +1,7 @@
package org.communiquons.android.comunic.client.ui.fragments;
import android.app.AlertDialog;
import android.app.Fragment;
import android.support.v4.app.Fragment;
import android.content.Context;
import android.content.DialogInterface;
import android.os.AsyncTask;

View File

@ -1,7 +1,8 @@
package org.communiquons.android.comunic.client.ui.fragments;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.Nullable;
@ -89,12 +90,12 @@ public class LatestPostsFragment extends Fragment
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_latest_posts, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
//Get some of the views

View File

@ -1,7 +1,8 @@
package org.communiquons.android.comunic.client.ui.fragments;
import android.app.AlertDialog;
import android.app.Fragment;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.content.Context;
import android.content.DialogInterface;
import android.os.AsyncTask;
@ -103,12 +104,12 @@ public class NotificationsFragment extends Fragment implements View.OnCreateCont
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_notifications, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
//Get loading progress view

View File

@ -1,7 +1,8 @@
package org.communiquons.android.comunic.client.ui.fragments;
import android.app.AlertDialog;
import android.app.Fragment;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
@ -100,12 +101,12 @@ public class PostsCreateFormFragment extends Fragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_post_create_form, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
//Get post text area

View File

@ -1,7 +1,8 @@
package org.communiquons.android.comunic.client.ui.fragments;
import android.app.AlertDialog;
import android.app.Fragment;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.content.DialogInterface;
import android.os.AsyncTask;
import android.os.Bundle;
@ -163,12 +164,12 @@ public class PostsListFragment extends Fragment
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_postslist, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
//Get the list view

View File

@ -5,7 +5,6 @@ import android.preference.PreferenceFragment;
import android.support.annotation.Nullable;
import org.communiquons.android.comunic.client.R;
import org.communiquons.android.comunic.client.ui.activities.MainActivity;
/**
* Application preferences fragment
@ -31,8 +30,5 @@ public class SettingsFragment extends PreferenceFragment {
//Update the title
getActivity().setTitle(R.string.fragment_settings_title);
//Update the bottom navigation menu
((MainActivity) getActivity())
.setSelectedNavigationItem(R.id.main_bottom_navigation_me_view);
}
}

View File

@ -1,8 +1,8 @@
package org.communiquons.android.comunic.client.ui.fragments;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.Nullable;
@ -81,7 +81,7 @@ public class SinglePostFragment extends Fragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_single_post, container, false);
}

View File

@ -1,7 +1,8 @@
package org.communiquons.android.comunic.client.ui.fragments;
import android.app.Activity;
import android.app.Fragment;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
@ -183,12 +184,12 @@ public class UpdateConversationFragment extends Fragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_update_conversation, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
//Get the views

View File

@ -1,6 +1,7 @@
package org.communiquons.android.comunic.client.ui.fragments;
import android.app.Fragment;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.Nullable;
@ -126,12 +127,12 @@ public class UserAccessDeniedFragment extends Fragment implements View.OnClickLi
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_user_access_denied, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
//Get user related fields

View File

@ -1,7 +1,8 @@
package org.communiquons.android.comunic.client.ui.fragments;
import android.app.Fragment;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
@ -44,12 +45,12 @@ public class UserInfosFragment extends Fragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_userinfos, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
//Get context

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/fragment" />

View File

@ -2,10 +2,12 @@
buildscript {
repositories {
jcenter{url "http://jcenter.bintray.com/"}
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@ -14,8 +16,10 @@ buildscript {
allprojects {
repositories {
jcenter{url "http://jcenter.bintray.com/"}
google()
jcenter()
}
}
task clean(type: Delete) {

View File

@ -1,6 +1,6 @@
#Sun Oct 29 14:35:49 CET 2017
#Mon Jul 30 10:20:26 CEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip