Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
🚚 Move Android files to correct packages and rename plugin channels
Browse files Browse the repository at this point in the history
Android files are now all in package social.openbook.app

Plugins now all use okuna.io as channel prefix
  • Loading branch information
Komposten committed May 23, 2020
1 parent d43c373 commit caa10db
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.openbook;
package social.openbook.app;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import android.content.Intent;
import android.os.Bundle;
import com.example.openbook.plugins.ImageConverterPlugin;
import com.example.openbook.plugins.SharePlugin;
import social.openbook.app.plugins.ImageConverterPlugin;
import social.openbook.app.plugins.SharePlugin;
import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.plugins.PluginRegistry;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.example.openbook.plugins;
package social.openbook.app.plugins;

import androidx.annotation.NonNull;
import com.example.openbook.ImageConverter;
import com.example.openbook.ImageConverter.TargetFormat;
import social.openbook.app.ImageConverter;
import social.openbook.app.ImageConverter.TargetFormat;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
Expand All @@ -18,7 +17,7 @@ public class ImageConverterPlugin implements MethodCallHandler, FlutterPlugin {

@Override
public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {
methodChannel = new MethodChannel(binding.getBinaryMessenger(), "openspace.social/image_converter");
methodChannel = new MethodChannel(binding.getBinaryMessenger(), "okuna.io/image_converter");
methodChannel.setMethodCallHandler(this);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.openbook.plugins;
package social.openbook.app.plugins;

import android.content.Context;
import android.content.Intent;
Expand All @@ -7,8 +7,8 @@
import android.webkit.MimeTypeMap;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.openbook.ImageConverter;
import com.example.openbook.util.InputStreamSupplier;
import social.openbook.app.ImageConverter;
import social.openbook.app.util.InputStreamSupplier;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.plugin.common.EventChannel;

Expand All @@ -24,7 +24,7 @@ public class SharePlugin implements FlutterPlugin, EventChannel.StreamHandler {
@Override
public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {
applicationContext = binding.getApplicationContext();
eventChannel = new EventChannel(binding.getBinaryMessenger(), "openbook.social/receive_share");
eventChannel = new EventChannel(binding.getBinaryMessenger(), "okuna.io/receive_share");
eventChannel.setStreamHandler(this);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.openbook.util;
package social.openbook.app.util;

import java.io.FileNotFoundException;
import java.io.InputStream;
Expand Down
2 changes: 1 addition & 1 deletion ios/Runner/ImageConverterPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ typedef NS_ENUM(NSInteger, TargetFormat) {
@implementation ImageConverterPlugin
+ (void)registerWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar {
FlutterMethodChannel *channel =
[FlutterMethodChannel methodChannelWithName:@"openspace.social/image_converter"
[FlutterMethodChannel methodChannelWithName:@"okuna.io/image_converter"
binaryMessenger:[registrar messenger]];
ImageConverterPlugin *instance = [[ImageConverterPlugin alloc] init];
[registrar addMethodCallDelegate:instance channel:channel];
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/image_converter/image_converter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:flutter/services.dart';

class ImageConverter {
static const MethodChannel _channel =
const MethodChannel('openspace.social/image_converter');
const MethodChannel('okuna.io/image_converter');

static Future<List<int>> convertImage(List<int> imageData, [TargetFormat format = TargetFormat.JPEG]) async {
String formatName;
Expand Down
2 changes: 1 addition & 1 deletion lib/services/share.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class ShareService {
static const _stream = const EventChannel('openbook.social/receive_share');
static const _stream = const EventChannel('okuna.io/receive_share');

ToastService _toastService;
MediaService _mediaService;
Expand Down

0 comments on commit caa10db

Please sign in to comment.