Merge pull request #12 from sismics/master

Push to production
This commit is contained in:
Benjamin Gamard 2015-05-02 17:19:30 +02:00
commit 87b3d25c0f
11 changed files with 40 additions and 38 deletions

View File

@ -101,15 +101,15 @@
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="fab-0.0.6" level="project" />
<orderEntry type="library" exported="" name="support-v4-22.0.0" level="project" />
<orderEntry type="library" exported="" name="android-easing-1.0.3" level="project" />
<orderEntry type="library" exported="" name="imagezoom-1.0.5" level="project" />
<orderEntry type="library" exported="" name="support-annotations-22.0.0" level="project" />
<orderEntry type="library" exported="" name="eventbus-2.4.0" level="project" />
<orderEntry type="library" exported="" name="android-query.0.26.8" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-22.0.0" level="project" />
<orderEntry type="library" exported="" name="tokenautocomplete-1.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-22.1.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-22.1.0" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-22.0.0" level="project" />
<orderEntry type="library" exported="" name="android-async-http-1.4.6" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-22.1.0" level="project" />
</component>
</module>

View File

@ -35,7 +35,7 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:appcompat-v7:22.1.0'
compile 'com.android.support:recyclerview-v7:22.0.0'
compile 'com.loopj.android:android-async-http:1.4.6'
compile 'it.sephiroth.android.library.imagezoom:imagezoom:1.0.5'

View File

@ -3,7 +3,7 @@ package com.sismics.docs.activity;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
@ -43,7 +43,7 @@ import de.greenrobot.event.EventBus;
*
* @author bgamard.
*/
public class DocumentEditActivity extends ActionBarActivity {
public class DocumentEditActivity extends AppCompatActivity {
/**
* Document edited.
*/

View File

@ -13,7 +13,7 @@ import android.os.Bundle;
import android.os.Environment;
import android.support.v4.app.DialogFragment;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.text.format.DateFormat;
@ -57,7 +57,7 @@ import de.greenrobot.event.EventBus;
*
* @author bgamard
*/
public class DocumentViewActivity extends ActionBarActivity {
public class DocumentViewActivity extends AppCompatActivity {
/**
* Request code of adding file.
*/
@ -116,8 +116,10 @@ public class DocumentViewActivity extends ActionBarActivity {
// Setup the activity
setContentView(R.layout.document_view_activity);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
}
// Fill the view
refreshDocument(document);

View File

@ -3,7 +3,7 @@ package com.sismics.docs.activity;
import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.View;
@ -30,7 +30,7 @@ import org.json.JSONObject;
*
* @author bgamard
*/
public class LoginActivity extends ActionBarActivity {
public class LoginActivity extends AppCompatActivity {
/**
* User interface.

View File

@ -7,8 +7,8 @@ import android.content.res.Configuration;
import android.os.Bundle;
import android.provider.SearchRecentSuggestions;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;
import android.view.Menu;
import android.view.MenuInflater;
@ -39,7 +39,8 @@ import de.greenrobot.event.EventBus;
*
* @author bgamard
*/
public class MainActivity extends ActionBarActivity {
public class MainActivity extends AppCompatActivity {
private ActionBarDrawerToggle drawerToggle;
private MenuItem searchItem;
@ -61,8 +62,10 @@ public class MainActivity extends ActionBarActivity {
// Enable ActionBar app icon to behave as action to toggle nav drawer
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
}
// ActionBarDrawerToggle ties together the the proper interactions
// between the sliding drawer and the action bar app icon

View File

@ -1,7 +1,7 @@
package com.sismics.docs.activity;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import com.sismics.docs.fragment.SettingsFragment;
@ -11,14 +11,16 @@ import com.sismics.docs.fragment.SettingsFragment;
*
* @author bgamard.
*/
public class SettingsActivity extends ActionBarActivity {
public class SettingsActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
}
// Display the fragment as the main content.
getFragmentManager().beginTransaction()

View File

@ -48,6 +48,11 @@ public class FileCreatedAsyncListener {
@Override
public void run() {
FileDao fileDao = new FileDao();
if (fileDao.getById(file.getId()) == null) {
// The file has been deleted since the OCR-ization started, ignore the result
return;
}
file.setContent(content);
fileDao.update(file);
}

View File

@ -95,20 +95,6 @@ angular.module('docs').controller('Document', function($scope, $timeout, $state,
$scope.loadDocuments();
});
/**
* Go to add document form.
*/
$scope.addDocument = function() {
$state.transitionTo('document.add');
};
/**
* Go to edit document form.
*/
$scope.editDocument = function(id) {
$state.transitionTo('document.edit', { id: id });
};
/**
* Display a document.
*/

View File

@ -2,7 +2,7 @@
<div class="col-md-4">
<div class="well">
<p class="text-center">
<button class="btn btn-primary" type="button" ng-click="addDocument()"><span class="glyphicon glyphicon-plus"></span> Add a document</button>
<a href="#/document/add" class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span> Add a document</a>
</p>
<div class="input-group">
@ -34,7 +34,11 @@
</thead>
<tbody>
<tr ng-click="viewDocument(document.id)" ng-repeat="document in documents">
<td>{{ document.title }} ({{ document.file_count }}) <span class="glyphicon glyphicon-share" ng-if="document.shared" tooltip="Shared"></span></td>
<td>
{{ document.title }} ({{ document.file_count }})
<span class="glyphicon glyphicon-share" ng-if="document.shared" tooltip="Shared"></span>
<a href="#/document/view/{{ document.id }}" ng-click="$event.stopPropagation()"><span class="glyphicon glyphicon-link"></span></a>
</td>
<td>{{ document.create_date | date: 'yyyy-MM-dd' }}</td>
<td class="hidden-xs cell-tags">
<div class="tags">
@ -48,7 +52,7 @@
</table>
<div class="text-center pagination-box">
<pagination total-items="totalDocuments" max-size="5" page="currentPage"></pagination>
<pagination total-items="totalDocuments" items-per-page="limit" max-size="5" page="currentPage"></pagination>
<label class="sr-only" for="pagesizeSelect">Page size</label>
<select ng-model="limit" id="pagesizeSelect" class="form-control">
<option value="10">10 per page</option>

View File

@ -4,7 +4,7 @@
<div class="text-right">
<div class="btn-group">
<button class="btn btn-danger" ng-click="deleteDocument(document)"><span class="glyphicon glyphicon-trash"></span> Delete</button>
<button class="btn btn-primary" ng-click="editDocument(document.id)"><span class="glyphicon glyphicon-pencil"></span> Edit</button>
<a href="#/document/edit/{{ document.id }}" class="btn btn-primary"><span class="glyphicon glyphicon-pencil"></span> Edit</a>
</div>
</div>