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

Commit

Permalink
Merge pull request #5 from Arjun-sna/dev
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
Arjun authored Sep 22, 2017
2 parents 669aec6 + b6a1dfd commit a438b46
Show file tree
Hide file tree
Showing 35 changed files with 49 additions and 330 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "in.arjsna.audiorecorder"
minSdkVersion 16
targetSdkVersion 26
versionCode 2
versionName "2.0"
versionCode 3
versionName "3.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class PlayListActivity extends BaseActivity {
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_record_list);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class SettingsActivity extends BaseActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_preferences);

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.support.v7.app.AppCompatActivity;
import in.arjsna.audiorecorder.AppConstants;
import in.arjsna.audiorecorder.R;
import in.arjsna.audiorecorder.di.ActivityContext;
import in.arjsna.audiorecorder.di.qualifiers.ActivityContext;
import in.arjsna.audiorecorder.mvpbase.BasePresenter;
import in.arjsna.audiorecorder.recordingservice.AudioRecorder;
import io.reactivex.disposables.CompositeDisposable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import in.arjsna.audiorecorder.activities.PlayListActivity;
import in.arjsna.audiorecorder.activities.SettingsActivity;
import in.arjsna.audiorecorder.audiovisualization.GLAudioVisualizationView;
import in.arjsna.audiorecorder.di.ActivityContext;
import in.arjsna.audiorecorder.di.qualifiers.ActivityContext;
import in.arjsna.audiorecorder.di.components.ActivityComponent;
import in.arjsna.audiorecorder.mvpbase.BaseFragment;
import in.arjsna.audiorecorder.recordingservice.AudioRecordService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;
import java.util.ArrayList;
import java.util.List;

@Dao public interface RecordItemDao {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import in.arjsna.audiorecorder.activities.MainActivity;
import in.arjsna.audiorecorder.activities.PlayListActivity;
import in.arjsna.audiorecorder.activities.SettingsActivity;
import in.arjsna.audiorecorder.di.PerActivity;
import in.arjsna.audiorecorder.di.scopes.ActivityScope;
import in.arjsna.audiorecorder.di.modules.ActivityModule;
import in.arjsna.audiorecorder.audiorecording.RecordFragment;
import in.arjsna.audiorecorder.playlist.PlayListFragment;

@PerActivity
@ActivityScope
@Component(dependencies = ApplicationComponent.class, modules = ActivityModule.class)
public interface ActivityComponent {
void inject(MainActivity mainActivity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import dagger.Component;
import in.arjsna.audiorecorder.AudioRecorderApp;
import in.arjsna.audiorecorder.db.RecordItemDataSource;
import in.arjsna.audiorecorder.di.ApplicationContext;
import in.arjsna.audiorecorder.di.qualifiers.ApplicationContext;
import in.arjsna.audiorecorder.di.modules.ApplicationModule;
import javax.inject.Singleton;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package in.arjsna.audiorecorder.di.components;

import dagger.Component;
import in.arjsna.audiorecorder.di.PerService;
import in.arjsna.audiorecorder.di.scopes.ServiceScope;
import in.arjsna.audiorecorder.di.modules.ServiceModule;
import in.arjsna.audiorecorder.recordingservice.AudioRecordService;

@PerService
@ServiceScope
@Component(dependencies = ApplicationComponent.class, modules = ServiceModule.class)
public interface ServiceComponent {
void inject(AudioRecordService audioRecordService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
import in.arjsna.audiorecorder.audiorecording.AudioRecordMVPView;
import in.arjsna.audiorecorder.audiorecording.AudioRecordPresenter;
import in.arjsna.audiorecorder.audiorecording.AudioRecordPresenterImpl;
import in.arjsna.audiorecorder.db.RecordItemDataSource;
import in.arjsna.audiorecorder.db.RecordingItem;
import in.arjsna.audiorecorder.di.ActivityContext;
import in.arjsna.audiorecorder.di.PerActivity;
import in.arjsna.audiorecorder.di.qualifiers.ActivityContext;
import in.arjsna.audiorecorder.di.scopes.ActivityScope;
import in.arjsna.audiorecorder.playlist.PlayListMVPView;
import in.arjsna.audiorecorder.playlist.PlayListPresenter;
import in.arjsna.audiorecorder.playlist.PlayListPresenterImpl;
Expand All @@ -28,35 +26,38 @@ public ActivityModule(AppCompatActivity appCompatActivity) {

@Provides
@ActivityContext
@ActivityScope
AppCompatActivity provideActivityContext() {
return appCompatActivity;
}

@Provides
@ActivityScope
CompositeDisposable provideCompositeDisposable() {
return new CompositeDisposable();
}

@Provides
@ActivityScope
LinearLayoutManager provideLinearLayoutManager(@ActivityContext AppCompatActivity context) {
return new LinearLayoutManager(context);
}

@Provides
PlayListAdapter providesPlayListAdapter(@ActivityContext AppCompatActivity context,
RecordItemDataSource recordItemDataSource) {
return new PlayListAdapter(context, recordItemDataSource, new ArrayList<RecordingItem>());
@ActivityScope
PlayListAdapter providesPlayListAdapter(@ActivityContext AppCompatActivity context) {
return new PlayListAdapter(context, new ArrayList<>());
}

@Provides
@PerActivity
@ActivityScope
AudioRecordPresenter<AudioRecordMVPView> provideAudioRecordPresenter(
AudioRecordPresenterImpl<AudioRecordMVPView> audioRecordPresenter) {
return audioRecordPresenter;
}

@Provides
@PerActivity
@ActivityScope
PlayListPresenter<PlayListMVPView> providePlayListPresenter(
PlayListPresenterImpl<PlayListMVPView> playListPresenter) {
return playListPresenter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import dagger.Provides;
import in.arjsna.audiorecorder.db.AppDataBase;
import in.arjsna.audiorecorder.db.RecordItemDataSource;
import in.arjsna.audiorecorder.di.ApplicationContext;
import in.arjsna.audiorecorder.di.qualifiers.ApplicationContext;
import javax.inject.Singleton;

@Module
Expand All @@ -19,6 +19,7 @@ public ApplicationModule(Application application) {

@Provides
@ApplicationContext
@Singleton
Context provideApplicationContext() {
return application.getApplicationContext();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@

@Module
public class ServiceModule {
//@Provides
//AudioRecorder provideAudioRecorder(AudioRecorder audioRecorder) {
// return audioRecorder;
//}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package in.arjsna.audiorecorder.di;
package in.arjsna.audiorecorder.di.qualifiers;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package in.arjsna.audiorecorder.di;
package in.arjsna.audiorecorder.di.qualifiers;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package in.arjsna.audiorecorder.di;
package in.arjsna.audiorecorder.di.scopes;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import javax.inject.Scope;

@Scope
@Retention(RetentionPolicy.RUNTIME)
public @interface PerService {
public @interface ActivityScope {
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package in.arjsna.audiorecorder.di;
package in.arjsna.audiorecorder.di.scopes;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import javax.inject.Scope;

@Scope
@Retention(RetentionPolicy.RUNTIME)
public @interface PerActivity {
public @interface ServiceScope {
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public SettingBasic(Context context, @Nullable AttributeSet attrs, int defStyleA
}

private void initViews(View rootView) {
title = (TextView) rootView.findViewById(R.id.title);
caption = (TextView) rootView.findViewById(R.id.caption);
title = rootView.findViewById(R.id.title);
caption = rootView.findViewById(R.id.caption);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ public SettingWithSwitchView(Context context, @Nullable AttributeSet attrs, int
}

private void initViews(View rootView) {
title = (TextView) rootView.findViewById(R.id.title);
caption = (TextView) rootView.findViewById(R.id.caption);
toggle = (SwitchCompat) rootView.findViewById(R.id.toggle);
title = rootView.findViewById(R.id.title);
caption = rootView.findViewById(R.id.caption);
toggle = rootView.findViewById(R.id.toggle);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ public PlaybackFragment newInstance(RecordingItem item) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
View view = getActivity().getLayoutInflater().inflate(R.layout.fragment_media_playback, null);

TextView mFileNameTextView = (TextView) view.findViewById(R.id.file_name_text_view);
mFileLengthTextView = (TextView) view.findViewById(R.id.file_length_text_view);
mCurrentProgressTextView = (TextView) view.findViewById(R.id.current_progress_text_view);
TextView mFileNameTextView = view.findViewById(R.id.file_name_text_view);
mFileLengthTextView = view.findViewById(R.id.file_length_text_view);
mCurrentProgressTextView = view.findViewById(R.id.current_progress_text_view);

mSeekBar = (AppCompatSeekBar) view.findViewById(R.id.seekbar);
mSeekBar = view.findViewById(R.id.seekbar);
ColorFilter filter = new LightingColorFilter(getResources().getColor(R.color.primary),
getResources().getColor(R.color.primary));
mSeekBar.getProgressDrawable().setColorFilter(filter);
Expand Down Expand Up @@ -124,7 +124,7 @@ public PlaybackFragment newInstance(RecordingItem item) {
}
});

mPlayButton = (ThemedFab) view.findViewById(R.id.fab_play);
mPlayButton = view.findViewById(R.id.fab_play);
mPlayButton.setOnClickListener(v -> {
onPlay(isPlaying);
isPlaying = !isPlaying;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ public class PlayListAdapter extends RecyclerView.Adapter<PlayListAdapter.Record
private final ArrayList<RecordingItem> recordingItems;
private PlayListFragment listItemEventsListener;

public PlayListAdapter(Context context, RecordItemDataSource recordItemDataSource,
ArrayList<RecordingItem> recordingItems) {
public PlayListAdapter(Context context, ArrayList<RecordingItem> recordingItems) {
mContext = context;
this.recordingItems = recordingItems;
inflater = LayoutInflater.from(mContext);
Expand All @@ -47,9 +46,7 @@ public PlayListAdapter(Context context, RecordItemDataSource recordItemDataSourc
| DateUtils.FORMAT_SHOW_TIME
| DateUtils.FORMAT_SHOW_YEAR));

holder.cardView.setOnClickListener(view -> {
listItemEventsListener.onItemClick(position, currentRecording);
});
holder.cardView.setOnClickListener(view -> listItemEventsListener.onItemClick(position, currentRecording));

holder.cardView.setOnLongClickListener(v -> {
listItemEventsListener.onItemLongClick(position, currentRecording);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private Notification createNotification(AudioRecorder.RecordTime recordTime) {
lastUpdated = recordTime;
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(getApplicationContext()).setSmallIcon(
R.drawable.ic_launcher_background)
R.drawable.ic_media_record)
.setContentTitle(getString(R.string.notification_recording))
.setContentText(
String.format(Locale.getDefault(), getString(R.string.record_time_format),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package in.arjsna.audiorecorder.recordingservice;

import android.content.Context;
import android.media.AudioRecord;
import android.media.MediaRecorder;
import android.util.Log;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public void onColorChanged(int color) {
}

private void initViews() {
themeSetting = (SettingBasic) rootView.findViewById(R.id.theme_settings);
rateApp = (SettingBasic) rootView.findViewById(R.id.rate_app);
themeSetting = rootView.findViewById(R.id.theme_settings);
rateApp = rootView.findViewById(R.id.rate_app);
}

//Preference aboutPref = findPreference(getString(R.string.pref_about_key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ public void chooseColor(@StringRes int title, final ColorChooser chooser, int de
View dialogLayout =
LayoutInflater.from(getActivity()).inflate(R.layout.dialog_color_picker, null);
final LineColorPicker colorPicker =
(LineColorPicker) dialogLayout.findViewById(R.id.color_picker_primary);
dialogLayout.findViewById(R.id.color_picker_primary);
final LineColorPicker colorPicker2 =
(LineColorPicker) dialogLayout.findViewById(R.id.color_picker_primary_2);
final TextView dialogTitle = (TextView) dialogLayout.findViewById(R.id.dialog_title);
dialogLayout.findViewById(R.id.color_picker_primary_2);
final TextView dialogTitle = dialogLayout.findViewById(R.id.dialog_title);
dialogTitle.setText(title);
dialogTitle.setBackgroundColor(getActivity().getPrimaryColor());
colorPicker.setSelected(true);
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/dialog_color_picker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
android:textSize="18sp"
android:textStyle="bold"/>
<LinearLayout
android:id="@+id/container_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/fragment_file_viewer.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_file_viewer"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/layout/fragment_media_playback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/mediaplayer_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
Expand Down Expand Up @@ -37,7 +36,7 @@
android:fontFamily="sans-serif-condensed"
/>

<SeekBar
<android.support.v7.widget.AppCompatSeekBar
android:id="@+id/seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/fragment_record.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/fragment_record"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/fragment_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<in.arjsna.audiorecorder.libs.SettingWithSwitchView
android:id="@+id/audio_quality_settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:settingTitle="@string/pref_high_quality_title"
Expand Down
Loading

0 comments on commit a438b46

Please sign in to comment.