Skip to content
Closed
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
31 changes: 22 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,54 @@
language: android
jdk: oraclejdk8
sudo: false
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache

notifications:
email: false
webhooks: "https://zapier.com/hooks/catch/opzg6m/"

android:
components:
# Uncomment the lines below if you want to
# use the latest revision of Android SDK Tools
# Note that the tools section appears twice on purpose as its required to get the newest Android SDK tools
- tools
- build-tools-25.0.0
- platform-tools
- android-23
- sys-img-armeabi-v7a-android-19
- tools
# The BuildTools version used by your project
- build-tools-25.0.0
- extra-android-support
- extra-google-m2repository
- extra-android-m2repository
# emulator(s)
- android-22
- sys-img-armeabi-v7a-android-22
licenses:
- 'android-sdk-license-5be876d5'
- 'android-sdk-preview-license-52d11cd2'
# - 'android-sdk-license-5be876d5'
- 'android-sdk-license-c81a61d9'
# - 'android-googletv-license-99eda7fb'
- 'google-gdk-license-9529f459'

before_script:
# Create and start emulator
- echo no | android create avd --force -n test -t android-19 --abi armeabi-v7a
- emulator -avd test -no-skin -no-audio -no-window &
- adb wait-for-device
# Emulator Management: Create, Start and Wait
- echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a
- emulator -avd test -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
# Setup build envrionment
- openssl aes-256-cbc -K $encrypted_7fcdb5fbc52e_key -iv $encrypted_7fcdb5fbc52e_iv -in external/localsettings.tar.gz.enc -out localsettings.tar.gz -d
- tar xzf localsettings.tar.gz && mv id_edca ~/.ssh/ && mv id_config ~/.ssh/config
# fix gradle license errors
- mkdir -p "/usr/local/android-sdk/licenses"
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "/usr/local/android-sdk/licenses/android-sdk-license"
- echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "/usr/local/android-sdk/licenses/android-sdk-preview-license"

script:
- ./gradlew build connectedCheck
Expand Down
2 changes: 1 addition & 1 deletion OpenRedmine/OpenRedmine.iml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes" />
Expand All @@ -101,6 +100,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
Expand Down
4 changes: 2 additions & 2 deletions OpenRedmine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
minSdkVersion 9
targetSdkVersion 23

versionCode 53
versionName '3.20'
versionCode 56
versionName '3.21'
testApplicationId "jp.redmine.redmineclienttest"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
testHandleProfiling true
Expand Down
2 changes: 2 additions & 0 deletions OpenRedmine/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import java.sql.SQLException;

import com.j256.ormlite.android.apptools.OrmLiteBaseActivity;
import com.j256.ormlite.android.apptools.OrmLiteFragmentActivity;

import jp.redmine.redmineclient.R;
import jp.redmine.redmineclient.activity.helper.ActivityHelper;
Expand All @@ -18,15 +18,11 @@
import android.view.View;
import android.view.View.OnClickListener;

public class FilterViewActivity extends OrmLiteBaseActivity<DatabaseCacheHelper> {
public class FilterViewActivity extends OrmLiteFragmentActivity<DatabaseCacheHelper> {
public FilterViewActivity(){
super();
}

@Override
protected void onDestroy() {
super.onDestroy();
}
private RedmineIssueFilter form;

/** Called when the activity is first created. */
Expand All @@ -35,6 +31,7 @@ public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityHelper.setupTheme(this);
setContentView(R.layout.page_issuefilter);
getSupportActionBar();

form = new RedmineIssueFilter();
form.setup(this,getHelper());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public View getHeaderView(int position, View convertView, ViewGroup parent) {
}
RedmineIssue rec = super.getDbItem(position);
form.setValue(rec);
form.clearJournalNo();
return convertView;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ protected QueryBuilder<RedmineIssue, Long> getSearchQueryBuilder(String search)

protected void setupWhere(RedmineFilter filter,
Where<RedmineIssue, Long> where) throws SQLException {
Hashtable<String, Object> dic = new Hashtable<String, Object>();
Hashtable<String, Object> dic = new Hashtable<>();
if(filter.getConnectionId() != null) dic.put(RedmineFilter.CONNECTION, filter.getConnectionId());
if(filter.getProject() != null) dic.put(RedmineFilter.PROJECT, filter.getProject() );
if(filter.getTracker() != null) dic.put(RedmineFilter.TRACKER, filter.getTracker() );
Expand All @@ -147,6 +147,13 @@ protected void setupWhere(RedmineFilter filter,
if(filter.getPriority() != null) dic.put(RedmineFilter.PRIORITY, filter.getPriority() );

boolean isFirst = true;
if(filter.isClosed() != null) {
isFirst = false;
if(filter.isClosed())
where.isNotNull(RedmineFilter.CLOSED);
else
where.isNull(RedmineFilter.CLOSED);
}
for(Enumeration<String> e = dic.keys() ; e.hasMoreElements() ;){
String key = e.nextElement();
if(dic.get(key) == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
LayoutInflater infalInflater = (LayoutInflater) parent.getContext()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = getItemView(infalInflater);
convertView = getItemView(infalInflater, parent);
convertView.setTag(getItemViewId());
}
if(convertView != null){
Expand All @@ -122,8 +122,8 @@ public View getView(int position, View convertView, ViewGroup parent) {
}
return convertView;
}
protected View getItemView(LayoutInflater infalInflater){
return infalInflater.inflate(getItemViewId(), null);
protected View getItemView(LayoutInflater infalInflater, ViewGroup parent){
return infalInflater.inflate(getItemViewId(), parent, false);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class IssueDetailForm extends IssueBaseForm {
public TextView textProject;
public TextView textPrivate;
public TextView textCreated;
public TextView textClosed;
public TextView textProgress;
public TextView textTimeEstimate;
public TextView textTimeEntry;
Expand All @@ -28,6 +29,7 @@ public class IssueDetailForm extends IssueBaseForm {
public TextView labelAssignedTo;
public TextView labelTime;
public TextView labelTimeSlice;
public TextView labelClosed;
public TextView labelProject;
public TextView textView;
public TextViewHelper textViewHelper;
Expand Down Expand Up @@ -60,6 +62,8 @@ public void setup(View view){
labelTime = (TextView)view.findViewById(R.id.labelTime);
labelTimeSlice = (TextView)view.findViewById(R.id.labelTimeSlice);
labelProject = (TextView)view.findViewById(R.id.labelProject);
textClosed = (TextView)view.findViewById(R.id.textClosed);
labelClosed = (TextView)view.findViewById(R.id.labelClosed);
textView = (TextView)view.findViewById(R.id.textView);
}

Expand All @@ -75,9 +79,11 @@ public void setValue(RedmineIssue rd){
setPrivate(rd.isPrivate());
setTime(textTimeEstimate,R.string.ticket_time_estimate,rd.getEstimatedHours());
setMasterName(textCategory,rd.getCategory());
setDateTime(textClosed, rd.getClosed());
setVisible(rd.getCategory(), labelCategory, textCategory);
setVisible(rd.getVersion(), labelVersion, textVersion);
setVisible(rd.getAssigned(), labelAssignedTo, textAssignedTo);
setVisible(rd.getClosed() != null, labelClosed, textClosed);
setVisible(!(rd.getDateStart() == null && rd.getDateDue() == null), labelDate,textDateFrom, textDateTo, labelDateArrow);
setVisible(rd.getEstimatedHours() != 0, labelTime, textTimeEstimate, labelTimeSlice);
setMasterName(textProject, rd.getProject());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected void genericSetValue(RedmineIssue rd){
textDescription.setText(rd.getDescription());

boolean isEnabled = true;
if(rd.getStatus() != null && rd.getStatus().isIs_close()){
if(rd.getStatus() != null && rd.getStatus().isClose()){
isEnabled = false;
}
performSetEnabled((ViewGroup)(textSubject.getParent()), isEnabled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ public void setup(View view){
textUser = (TextView)view.findViewById(R.id.user);
textDate = (TextView)view.findViewById(R.id.date);
textNo = (TextView)view.findViewById(R.id.no);
textNo.setText("");
clearJournalNo();
}
public void setJournalNo(int no){
textNo.setText(textNo.getContext().getString(R.string.ticket_journal_id, no));
}
public void clearJournalNo(){
textNo.setText("");
}
public void setValue(RedmineJournal jr){
setUserName(textUser, jr.getUser());
setDateTimeSpan(textDate,jr.getCreated());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

public class DatabaseCacheHelper extends OrmLiteSqliteOpenHelper {
private static String DB_NAME="OpenRedmineCache.db";
private static int DB_VERSION=17;
private static int DB_VERSION=18;

public DatabaseCacheHelper(Context context) {
super(context, getDatabasePath(context), null, DB_VERSION);
Expand Down Expand Up @@ -123,6 +123,9 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource source, int older,int
TableUtils.createTable(source, RedmineRecentIssue.class);
case 16:
TableUtils.createTable(source, RedmineWatcher.class);
case 17:
if(older > 1)
addColumn(db, RedmineFilter.class,"is_closed INTEGER");
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ public boolean isSameInner(String a, String b) {
return a.equals(b);
}
};
Compare<Boolean> compareBoolean = new Compare<Boolean>() {
@Override
public boolean isSameInner(Boolean a, Boolean b) {
return a.equals(b);
}
};
for(RedmineFilter item : fetchAllByConnection(filter.getConnectionId())){
if(!compareMaster.isSame(filter.getProject(), item.getProject()))
continue;
Expand All @@ -120,8 +126,8 @@ public boolean isSameInner(String a, String b) {
continue;
if(!compareString.isSame(filter.getSort(), item.getSort()))
continue;


if(!compareBoolean.isSame(filter.isClosed(), item.isClosed()))
continue;
return item;
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.j256.ormlite.stmt.PreparedQuery;
import com.j256.ormlite.stmt.QueryBuilder;

import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -107,7 +108,7 @@ public RedmineIssue fetchById(int connection, int issueId) throws SQLException{
return item;
}

public Long getIdByIssue(int connection, int issueId) throws SQLException{
public Long getIdByIssue(int connection, int issueId) throws SQLException, IOException{
QueryBuilder<RedmineIssue, Long> builder = builderByIssue(dao, connection,issueId);

builder.selectRaw(RedmineIssue.ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ public int delete(int id) throws SQLException{

public void refreshItem(RedmineIssue data) throws SQLException{
RedmineStatus item = refreshItem(data.getConnectionId(),data.getStatus());

if(!item.isClose() && data.getClosed() != null)
data.setClosed(null);
data.setStatus(item);
}
public RedmineStatus refreshItem(RedmineConnection info,RedmineStatus data) throws SQLException{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class RedmineFilter
public final static String CATEGORY = "category_id";
public final static String VERSION = "version_id";
public final static String CURRENT = "is_current";
public final static String CLOSED = "closed";

@DatabaseField(generatedId = true)
private Integer id;
Expand Down Expand Up @@ -59,6 +60,8 @@ public class RedmineFilter
private String name;
@DatabaseField
private String sort;
@DatabaseField
private Boolean is_closed;

@DatabaseField
private Date created_from;
Expand Down Expand Up @@ -401,7 +404,7 @@ public void setSortList(List<RedmineFilterSortItem> items){
StringBuffer sb = new StringBuffer();
for(RedmineFilterSortItem item : items){
if(sb.length()>0)
sb.append(",");
sb.append("/");
sb.append(item.getRemoteKey());
if(!item.isAscending())
sb.append(" desc");
Expand All @@ -410,4 +413,11 @@ public void setSortList(List<RedmineFilterSortItem> items){
}


public Boolean isClosed() {
return is_closed;
}

public void setClosed(Boolean is_closed) {
this.is_closed = is_closed;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,34 +94,20 @@ public Date getModified() {
}


/**
* @param is_default セットする is_default
*/
public void setIs_default(boolean is_default) {
public void setDefault(boolean is_default) {
this.is_default = is_default;
}


/**
* @return is_default
*/
public boolean isIs_default() {
public boolean isDefault() {
return is_default;
}


/**
* @param is_close セットする is_close
*/
public void setIs_close(boolean is_close) {
public void setClose(boolean is_close) {
this.is_close = is_close;
}


/**
* @return is_close
*/
public boolean isIs_close() {
public boolean isClose() {
return is_close;
}

Expand Down
Loading