Commit f1b9831d authored by isnirp's avatar isnirp

anim resource added

parent 751f7554
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -16,6 +16,8 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ui.profile.ProfileActivity" />
<activity android:name=".ui.events.EventsActivity"></activity>
</application>
</manifest>
\ No newline at end of file
package com.flimbis.qi;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.flimbis.qi.ui.events.EventsActivity;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Intent intent = new Intent(this, EventsActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.slide_from_right/*enterAnimationId*/, R.anim.slide_to_left/*exitAnimationId*/);
}
}
package com.flimbis.qi.model;
public class EventModel {
}
package com.flimbis.qi.ui.events;
import android.app.PendingIntent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.flimbis.qi.R;
public class EventsActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_events);
}
@Override
public void finish() {
super.finish();
overridePendingTransition(R.anim.slide_from_left, R.anim.slide_to_right);
}
}
package com.flimbis.qi.ui.profile;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.flimbis.qi.R;
public class ProfileActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);
}
}
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="-100%p" android:toXDelta="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:duration="@integer/slide_animation_duration"/>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="100%p" android:toXDelta="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:duration="@integer/slide_animation_duration"/>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="0" android:toXDelta="-100%p"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:duration="@integer/slide_animation_duration"/>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="0" android:toXDelta="100%p"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:duration="@integer/slide_animation_duration"/>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.events.EventsActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="events"/>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.profile.ProfileActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="events"/>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="slide_animation_duration">300</integer>
</resources>
\ No newline at end of file
package com.flimbis.qi_core.interactor;
public class CreateEvent {
}
package com.flimbis.qi_core.interactor;
import com.flimbis.qi_core.entity.Event;
import com.flimbis.qi_core.repository.EventRepository;
import com.flimbis.qi_core.repository.TaskRepository;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.Scheduler;
public class GetAllEvents extends UseCase<List<Event>, Long> {
private EventRepository repository;
public GetAllEvents(EventRepository repository, Scheduler uiThread) {
super(uiThread);
this.repository = repository;
}
@Override
public Observable<List<Event>> buildObservable(Long id) {
return repository.getAll(id);
}
}
package com.flimbis.qi_core.interactor;
public abstract class UseCase {
import io.reactivex.Observable;
import io.reactivex.Scheduler;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.observers.DisposableObserver;
import io.reactivex.schedulers.Schedulers;
public abstract class UseCase<T, Params> {
private final Scheduler mUiThread;
private final CompositeDisposable mCompositeDisposable;
public UseCase(Scheduler uiThread) {
this.mUiThread = uiThread;
this.mCompositeDisposable = new CompositeDisposable();
}
public abstract Observable<T> buildObservable(Params p);
public void execute(DisposableObserver<T> disposableObserver, Params p) {
if (disposableObserver == null) {
throw new IllegalArgumentException("disposableObserver must not be null");
}
final Observable<T> observable = this.buildObservable(p)
.subscribeOn(Schedulers.io())
.observeOn(mUiThread);
DisposableObserver observer = observable.subscribeWith(disposableObserver);
mCompositeDisposable.add(observer);
}
public void dispose() {
if (!mCompositeDisposable.isDisposed()) {
mCompositeDisposable.dispose();
}
}
}
package com.flimbis.qi_core.repository;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.Single;
public interface BaseRepository<T> {
Observable<List<T>> getAll(long id);
Single<T> get(long id);
}
package com.flimbis.qi_core.repository;
import com.flimbis.qi_core.entity.Event;
public interface EventRepository extends BaseRepository<Event>{
}
package com.flimbis.qi_core.repository;
import com.flimbis.qi_core.entity.Task;
public interface TaskRepository extends BaseRepository<Task>{
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment